Diagnostic step 1
Separate routes: create an upstream (or location) dedicated for websocket/subscription paths without 'keepalive' set, and keep keepalive for short API requests.
Generated Oct 24, 2026, 9:21:01 AM
Separate routes: create an upstream (or location) dedicated for websocket/subscription paths without 'keepalive' set, and keep keepalive for short API requests.
Ensure websocket proxy settings in subscription location: 'proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade;' and define 'map $http_upgrade $connection_upgrade { default upgrade; '' close; }'.
Set 'proxy_buffering off' and increase 'proxy_read_timeout' to match expected subscription lifetime (e.g., 3600s).
Monitor NGINX and backend logs after change; run load tests to ensure connection utilization acceptable.
If upstream keepalive must remain for performance, consider deploying a separate lightweight TCP/stream proxy for websocket paths.