WebSocket connections require specific Nginx proxy configuration.
Configuration
server {\n listen 80;\n server_name ws.example.com;\n\n location / {\n proxy_pass http://127.0.0.1:3000;\n proxy_http_version 1.1;\n proxy_set_header Upgrade $http_upgrade;\n proxy_set_header Connection "upgrade";\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_read_timeout 86400;\n }\n}Key Settings
proxy_http_version 1.1— Required for WebSocketUpgradeandConnectionheaders — Enable protocol switchproxy_read_timeout— Prevent Nginx from closing idle WebSocket connections