user http; worker_processes auto; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; load_module /usr/lib/nginx/modules/ngx_rtmp_module.so; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout 65; server { listen 80 default_server; server_name localhost; types { application/vnd.apple.mpegurl m3u8; } root /data; add_header Cache-Control no-cache; add_header Access-Control-Allow-Origin *; } } rtmp { access_log off; server { listen 1935; application hls { live on; hls on; hls_fragment 15s; hls_fragment_naming system; hls_fragment_slicing aligned; hls_path /data; hls_playlist_length 24h; hls_nested on; } } }