ACTIVITY
Timeline
Timeline for the post: NGINX returns 502 on WebSocket upgrade when TLS session resumption and upstream keepalive enabled
Currently licensed under: CC BY-SA 4.0
| When | What | By | License | Comment |
|---|---|---|---|---|
Oct 24, 2026, 9:21:01 AM 1mo ago | Answer | aliceadmin | CC BY-SA 4.0 | First check backend idle timeouts: make Node.js keepAliveTimeout longer than NGINX's proxy_read_timeout so NGINX doesn't reuse a socket the app has already closed. As a quick mitigation, avoid reusing backend sockets for Upgrade by mapping $http_upgrade and forcing Connection: close for non-upgrade flows (so Upgrade gets a fresh backend handshake). Verify by opening a persistent WebSocket and repeatedly reconnecting with TLS session resumption; failures should stop. Roll back by restoring previous keepalive values if new behavior causes load issues and instead enable proxy_next_upstream retry with short keepalive. |
Oct 24, 2026, 9:21:01 AM 1mo ago | Created | noahnode | CC BY-SA 4.0 | NGINX returns 502 on WebSocket upgrade when TLS session resumption and upstream keepalive enabled |