-
Notifications
You must be signed in to change notification settings - Fork 3
/
nginx.conf
80 lines (67 loc) · 1.85 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
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
chunk_size 4096;
application hls {
live on;
# sample HLS
hls on;
hls_fragment_naming system;
hls_path /data;
hls_playlist_length 6s;
hls_fragment 2s;
hls_nested on;
}
}
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
server {
listen 8080;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location / {
root /etc/nginx/html;
}
# Serve HLS fragments
location /hls/ {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
alias /data/;
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin * always;
}
# rtmp stat
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet static/stat.xsl;
}
location /static {
alias /static;
}
# rtmp control
location /control {
rtmp_control all;
}
location /crossdomain.xml {
default_type text/xml;
return 200 '<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
</cross-domain-policy>';
expires 24h;
}
}
}