worker_processes auto; events { worker_connections 1024; } rtmp { server { listen 1935; chunk_size 4096; application live { live on; record off; allow publish all; allow play all; hls on; hls_path /tmp/hls; hls_fragment 3; hls_playlist_length 60; } } } # Serve the HLS segments over HTTP http { server { listen 8088; location /hls { types { application/vnd.apple.mpegurl m3u8; # proper MIME for HLS playlists video/mp2t ts; # MPEG-TS segment MIME } root /tmp; add_header Cache-Control no-cache; # prevent stale segments add_header Access-Control-Allow-Origin *; # CORS for browser playback } } }