forked from fragforce/fragcenter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
86 lines (66 loc) · 1.87 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
## docker run -it -d --rm -p 1935:1935 -p 8080:80 -v /srv/rtmp/nginx.conf:/opt/nginx/nginx.conf alfg/nginx-rtmp
daemon off;
error_log logs/error.log debug;
events {
worker_connections 1024;
}
http {
include mime.types;
sendfile on;
keepalive_timeout 65;
server {
listen 8080;
server_name _;
client_max_body_size 128M;
add_header Access-Control-Allow-Origin * always;
add_header Cache-Control no-cache always;
# Return an empty response, used by dash.js to sync with server time
location /time {
return 200;
}
# DASH files
location /dash {
root /tmp;
}
# HLS files
location /hls {
root /tmp;
}
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet static/stat.xsl;
}
location /static {
alias /www/static;
}
location = /crossdomain.xml {
root /www/static;
default_type text/xml;
expires 24h;
}
}
}
rtmp {
server {
listen 1935;
chunk_size 4096;
application stream {
live on;
record off;
# This block is to save streams to the /recordings volume
# recorder dump {
# record all;
# record_path /recordings;
# record_unique on;
# record_interval 30s;
# }
exec ffmpeg -i rtmp://localhost/$app/$name -async 1 -vsync -1 -c:v libx264 -c:a libvo_aacenc -b:v 256k -b:a 32k -vf "scale=480:trunc(ow/a/2)*2" -tune zerolatency -preset veryfast -crf 23 -f flv rtmp://localhost/dash/$name;
}
application dash {
live on;
dash on;
dash_path /tmp/dash;
dash_nested on;
}
}
}