mirror of
https://github.com/cupcakearmy/livestream.git
synced 2024-12-21 15:46:33 +00:00
64 lines
1.1 KiB
Nginx Configuration File
64 lines
1.1 KiB
Nginx Configuration File
load_module modules/ngx_rtmp_module.so;
|
|
rtmp_auto_push on;
|
|
# rtmp_auto_push_reconnect 1s;
|
|
# rtmp_socket_dir /var/sock;
|
|
|
|
user nginx;
|
|
error_log stderr;
|
|
pid /var/run/nginx.pid;
|
|
worker_processes 1;
|
|
|
|
events {}
|
|
|
|
rtmp {
|
|
server {
|
|
listen 1935;
|
|
|
|
application live {
|
|
live on;
|
|
record off;
|
|
|
|
dash on;
|
|
dash_path /stream/dash;
|
|
|
|
hls on;
|
|
hls_path /stream/hls;
|
|
|
|
deny play all;
|
|
}
|
|
}
|
|
}
|
|
|
|
# HTTP can be used for accessing RTMP stats
|
|
http {
|
|
|
|
server {
|
|
listen 80;
|
|
|
|
location / {
|
|
root /srv;
|
|
}
|
|
|
|
location /stat {
|
|
rtmp_stat all;
|
|
rtmp_stat_stylesheet stat.xsl;
|
|
}
|
|
location /stat.xsl {
|
|
root /path/to/stat.xsl/;
|
|
}
|
|
|
|
location /hls {
|
|
types {
|
|
application/vnd.apple.mpegurl m3u8;
|
|
video/mp2t ts;
|
|
}
|
|
root /stream;
|
|
add_header Cache-Control no-cache;
|
|
}
|
|
|
|
location /dash {
|
|
root /stream;
|
|
add_header Cache-Control no-cache;
|
|
}
|
|
}
|
|
} |