-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathlivepeer-nginx
executable file
·114 lines (91 loc) · 2.6 KB
/
livepeer-nginx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
set -euo pipefail
if [[ $* == *-j* ]]; then
echo '{
"desc": "Livepeer-packaged nginx",
"name": "Livepeer nginx",
"optional": {}
}'
exit 0
fi
cat > /etc/nginx/nginx.conf << EOF
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
daemon off;
events {
worker_connections 768;
# multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
client_max_body_size 10G;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
access_log /proc/1/fd/2;
error_log /proc/1/fd/2;
gzip on;
server {
listen 8888;
server_name _;
absolute_redirect off;
location /mist/hls/ {
proxy_pass http://localhost:8081/hls/;
proxy_set_header X-Real-IP \$remote_addr;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_read_timeout 600s;
proxy_set_header Host \$host;
proxy_set_header X-Mst-Path "\$scheme://\$host:8888/mist";
}
location /mist/ {
proxy_pass http://localhost:8080/;
proxy_set_header X-Real-IP \$remote_addr;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_read_timeout 600s;
proxy_set_header Host \$host;
proxy_set_header X-Mst-Path "\$scheme://\$host:\$server_port/mist";
}
proxy_set_header Host \$host:\$server_port;
proxy_set_header X-Forwarded-For \$remote_addr;
location /hls/ {
proxy_pass http://127.0.0.1:8989;
}
location /webrtc/ {
proxy_pass http://127.0.0.1:8989;
}
location /api/data/ {
proxy_pass http://127.0.0.1:3080;
}
location /data/ {
proxy_pass http://127.0.0.1:3080;
}
location /os-vod/ {
proxy_pass http://127.0.0.1:9000;
}
location /os-catalyst-vod/ {
proxy_pass http://127.0.0.1:9000;
}
location /os-private/ {
proxy_pass http://127.0.0.1:9000;
}
location /os-recordings/ {
proxy_pass http://127.0.0.1:9000;
}
location / {
proxy_pass http://127.0.0.1:3004;
}
}
}
EOF
exec nginx