events { worker_connections 1024; } http { server { listen 80; server_name localhost; root /usr/share/nginx/html; index index.html; # Serve static frontend location / { try_files $uri $uri/ /index.html; } # Proxy chat WebSocket location /ws { proxy_pass http://chat:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; } # Serve HLS from playout (with cache headers for Cloudflare) location /hls/ { alias /usr/share/nginx/html/hls/; add_header Cache-Control "public, max-age=3600"; add_header Access-Control-Allow-Origin "*"; } # Health checks location /health { return 200 "healthy"; add_header Content-Type text/plain; } } }