forked from Guovin/iptv-api
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathnginx.conf
More file actions
70 lines (59 loc) · 1.75 KB
/
nginx.conf
File metadata and controls
70 lines (59 loc) · 1.75 KB
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
worker_processes 1;
error_log /var/log/nginx/error.log error;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
application hls {
live on;
hls on;
hls_path /tmp/hls;
hls_fragment 3s;
hls_playlist_length 60;
on_done http://127.0.0.1:5180/on_done;
}
}
}
http {
server {
listen 8080;
location / {
proxy_pass http://127.0.0.1:5180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
add_header Access-Control-Allow-Origin *;
}
# This URL provides RTMP statistics in XML
location /stat {
rtmp_stat all;
# Use this stylesheet to view XML as web page
# in browser
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
# XML stylesheet to view RTMP stats.
# Copy stat.xsl wherever you want
# and put the full directory path here
root /usr/local/nginx/html;
}
location ~ ^/hls/(.+)\.ts$ {
root /tmp;
types {
video/mp2t ts;
}
expires -1;
add_header Access-Control-Allow-Origin *;
}
location ~ ^/hls/(.+)\.m3u8$ {
proxy_pass http://127.0.0.1:5180/hls_proxy/$1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header Access-Control-Allow-Origin *;
}
}
}