When an edge reverse proxy maintains pooled HTTP/2 origin connections (for example, 900-second idle pools), setting origin keepalive_timeout slightly higher (such as 910s) eliminates race conditions where the origin closes a TCP socket at the exact millisecond a new stream frame arrives.
Similarly, ensuring response header buffers exceed default 4 KiB page sizes prevents upstream 502 errors when tracing headers are attached.