41 lines
937 B
Nginx Configuration File
41 lines
937 B
Nginx Configuration File
|
events {}
|
||
|
rtmp {
|
||
|
server {
|
||
|
listen 1935; # Listen on standard RTMP port
|
||
|
|
||
|
application live {
|
||
|
live on;
|
||
|
hls on;
|
||
|
hls_path /tmp/hls;
|
||
|
hls_fragment 10s; # default is 5s
|
||
|
hls_playlist_length 5m; # default is 30s
|
||
|
# once playlist length is reached it deletes the oldest fragments
|
||
|
|
||
|
# authentication
|
||
|
on_publish http://auth:8000/auth;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
http {
|
||
|
server {
|
||
|
listen 8080;
|
||
|
|
||
|
location / {
|
||
|
root /www;
|
||
|
}
|
||
|
|
||
|
location /hls {
|
||
|
types {
|
||
|
application/vnd.apple.mpegurl m3u8;
|
||
|
application/octet-stream ts;
|
||
|
}
|
||
|
root /tmp;
|
||
|
add_header Cache-Control no-cache;
|
||
|
|
||
|
# To avoid issues with cross-domain HTTP requests (e.g. during development)
|
||
|
add_header Access-Control-Allow-Origin *;
|
||
|
}
|
||
|
}
|
||
|
}
|