server { listen 80; # Serve the index.html file location / { root /app; # Root directory where your frontend files (index.html) are located index index.html; } # Proxy WebSocket requests location /ws/ { proxy_pass http://localhost:6060; # WebSocket backend proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } # Optional: Set cache headers for static files location /static/ { root /app; expires 30d; } }