forked from Garfield96/docker-nginx-rtmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
96 lines (84 loc) · 2.41 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
daemon off;
error_log /dev/stdout info;
events {
worker_connections 1024;
}
rtmp {
log_format compression '';
server {
listen ${RTMP_PORT};
ping 30s;
notify_method get;
chunk_size 8192;
ack_window 8192;
sync 4ms;
interleave on;
access_log logs/rtmp-access.log;
# Stream to "rtmp://IPHERE/publish/live".
application publish {
live on;
record off;
wait_video on;
wait_key on;
exec_options on;
publish_notify on;
play_restart on;
drop_idle_publisher 4s;
idle_streams off;
sync 4ms;
interleave on;
allow publish all;
#allow play 192.168.0.0/24;
#allow play 127.0.0.1;
#deny play all;
allow play all;
meta copy;
on_publish http://localhost/auth;
}
}
}
http {
root /www/static;
sendfile off;
tcp_nopush on;
server_tokens off;
access_log /dev/stdout combined;
# Uncomment these lines to enable SSL.
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_session_cache shared:SSL:10m;
# ssl_session_timeout 10m;
server {
listen ${HTTP_PORT};
# Uncomment these lines to enable SSL.
# Update the ssl paths with your own certificate and private key.
# listen ${HTTPS_PORT} ssl;
# ssl_certificate /opt/certs/example.com.crt;
# ssl_certificate_key /opt/certs/example.com.key;
# This URL provides RTMP statistics in XML
location ${STAT_LOCATION} {
if ($request_method = "GET") {
add_header "Access-Control-Allow-Origin" *;
}
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 /www/static;
}
location /auth {
if ($arg_psk = ${RTMP_STREAM_KEY}) {
return 201;
}
return 404;
}
location ${CONTROL_LOCATION} {
rtmp_control all;
}
}
}