Proxying WebSockets
WebSockets hold a connection open where ordinary web requests come and go. A proxy in front has to be told to keep those connections alive rather than closing them like any other request.
Handle the upgrade
A WebSocket starts as a normal request that asks to upgrade the connection. The proxy must pass the upgrade through rather than treating it as a plain request, or the connection never establishes — a common first stumble covered in nginx pitfalls.
Timeouts that fit long connections
Default proxy timeouts assume a request finishes in seconds. A WebSocket may sit mostly idle for minutes; without a generous read timeout the proxy cuts it off. Raise the timeout for the routes that carry them, not globally.
Routing and scale
If connections carry server-side state, they may need to return to the same backend, which argues for sticky routing at the load balancer. Many open connections also use real memory, so size the backends for concurrency, not request rate.
Still stuck? Mail support@novogara.com — an engineer answers, at any hour. Back to the knowledge base