3 Events
WhenWhatByLicenseComment
Oct 24, 2026, 9:21:01 AM
1mo ago
AnsweraliceadminCC BY-SA 4.0Start by treating subscriptions as a different traffic class: put websocket/GraphQL subscription endpoints in their own location and use an upstream without keepalive for that path. In the subscription location add: 'proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade;' (use a small map to set Connection to 'upgrade' when $http_upgrade present), turn off buffering and raise proxy_read_timeout. Restart nginx and exercise a subscription — it should stay open. This preserves keepalive benefits for normal HTTP API routes while avoiding connection reuse issues that cause 502s. Rollback is simple: restore the previous location block.
Oct 24, 2026, 9:21:01 AM
1mo ago
Solution acceptedmatte_devAn answer was marked as the accepted solution.
Oct 24, 2026, 9:21:01 AM
1mo ago
Createdmatte_devCC BY-SA 4.0Nginx returns 502 for long-lived GraphQL subscription requests only when upstream keepalive is enabled