-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
70 lines (58 loc) · 1.71 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
daemon off;
env PATH;
error_log /dev/stdout info;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
chunk_size 4000;
application live {
live on;
exec hls.sh $name 2>>/var/log/hls-$name.log;
}
application hls {
live on;
hls on;
hls_fragment_naming system;
hls_fragment 2;
hls_playlist_length 5;
hls_path /opt/data/hls;
hls_nested on;
hls_variant _2160p15256kbs BANDWIDTH=15256000,RESOLUTION=3840x2160;
hls_variant _1080p6160kbs BANDWIDTH=6160000,RESOLUTION=1920x1080;
hls_variant _720p3160kbs BANDWIDTH=3160000,RESOLUTION=1280x720;
hls_variant _480p1628kbs BANDWIDTH=1628000,RESOLUTION=854x480;
hls_variant _360p928kbs BANDWIDTH=928000,RESOLUTION=640x360;
hls_variant _240p596kbs BANDWIDTH=596000,RESOLUTION=426x240;
hls_variant _160p364kbs BANDWIDTH=364000,RESOLUTION=284x160;
}
}
}
http {
access_log /dev/stdout combined;
include mime.types;
default_type application/octet-stream;
server {
listen 80;
location /hls {
root /opt/data;
location ~* (.m3u8|png) {
add_header Cache-Control no-cache;
}
location ~* (.ts) {
add_header Cache-Control max-age=10;
}
}
location / {
root /www/static;
}
location /stream_stats {
auth_basic "private";
auth_basic_user_file /etc/nginx/htpasswd;
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
}
}