-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
166 lines (127 loc) · 4.1 KB
/
nginx.conf
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
error_log logs/error.log debug;
user user user;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
listen [::]:80;
server_name phystech.tv;
location /.well-known/acme-challenge {
root /var/www/letsencrypt;
}
location /obs-control {
root /home/user/webroot;
}
location / {
# root /home/user/webroot;
return 301 https://phystech.tv$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name phystech.tv;
ssl_certificate /etc/letsencrypt/live/phystech.tv/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/phystech.tv/privkey.pem;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_ciphers HIGH:!aNULL:!MD5;
# rtmp stat
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
root /usr/build/nginx-rtmp-module;
}
# rtmp control
location /control {
rtmp_control all;
}
location /dash {
types {
application/dash+xml mpd;
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /home/user/webroot;
add_header Cache-Control no-cache;
# To avoid issues with cross-domain HTTP requests (e.g. during development)
add_header Access-Control-Allow-Origin *;
}
location /hls {
types {
application/dash+xml mpd;
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
add_header Cache-Control no-cache;
# CORS setup
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length';
# allow CORS preflight requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
root /home/user/webroot;
}
location / {
root /home/user/webroot;
}
}
}
rtmp {
server {
listen 1935;
ping 30s;
notify_method get;
# application raw {
# live on;
# exec /usr/bin/ffmpeg -re -i rtmp://localhost:1935/raw/$name -vcodec flv -acodec copy -s 32x32 -f flv rtmp://localhost:1935/live/${name};
# }
application live {
live on;
# DASH
dash on;
dash_path /home/user/webroot/dash/;
# Turn on HLS
hls on;
hls_path /home/user/webroot/hls/;
hls_fragment 3;
hls_playlist_length 60;
# disable consuming the stream from nginx as rtmp
# deny play all;
push rtmp://a.rtmp.youtube.com/live2/ab13-dm36-bbmd-dvx8;
push rtmp://stream.vkuserlive.com:443/live?srv=637609&s=aWQ9U1l5NWtFdFprS2cmc2lnbj1POW9HVUNvT05zSGZlbzMxclc0WWVBPT0=/SYy5kEtZkKg;
}
application football {
live on;
# push ;
push rtmp://a.rtmp.youtube.com/live2/saye-j877-5uz3-2g2b;
push rtmp://phystech.tv/record/football;
push rtmp://phystech.tv/live/stream;
}
application studio107 {
live on;
# push rtmp://phystech.tv/record/$name;
}
application record {
live on;
recorder rec1 {
record all;
record_interval 120s;
record_path /home/user/FOOTBALL;
record_unique on;
}
}
}
}