worker_processes 1; pid /tmp/nginx/nginx.pid; events { worker_connections 1024; } rtmp { server { listen 1935; chunk_size 4096; application live { live on; allow publish all; allow play all; } application hls { live on; hls on; hls_path /tmp/nginx/html/media/hls; hls_fragment 3; hls_playlist_length 9; hls_variant _subsd BANDWIDTH=400000; hls_variant _sd BANDWIDTH=1000000; hls_variant _hd BANDWIDTH=5000000; allow publish all; allow play all; } application rhls { live on; hls on; hls_path /tmp/nginx/html/media/rhls; hls_fragment 3; hls_playlist_length 9; record all; record_path /tmp/nginx/html/media/recordings; record_unique on; record_append off; hls_variant _subsd BANDWIDTH=400000; hls_variant _sd BANDWIDTH=1000000; hls_variant _hd BANDWIDTH=5000000; allow publish all; allow play all; } } } http { include /tmp/nginx/mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; # Writable logs error_log /tmp/nginx/error.log info; access_log /tmp/nginx/access.log; # Temp path must be inside http block #client_body_temp_path /tmp/nginx/proxy_temp; server { listen 7860; # Serve HLS from /tmp/media/hls location / { root /tmp/nginx/html; index index.html; } location /hls { root /tmp/nginx/html/media; types { application/vnd.apple.mpegurl m3u8; video/mp2t ts; } add_header Cache-Control no-cache; add_header Access-Control-Allow-Origin *; autoindex on; } location /rhls { root /tmp/nginx/html/media; types { application/vnd.apple.mpegurl m3u8; video/mp2t ts; } add_header Cache-Control no-cache; add_header Access-Control-Allow-Origin *; autoindex on; } location /recordings { root /tmp/nginx/html/media; add_header Cache-Control no-cache; autoindex on; } location /stat { rtmp_stat all; rtmp_stat_stylesheet stat.xsl; } } }