Can an ALB target return a malformed response that causes 502?
Yes. Invalid HTTP status lines, premature closes, and protocol mismatches can prevent the load balancer from parsing a valid target response.
AWS ALB · HTTP 502
Investigate ALB 502 responses caused by target resets, malformed HTTP, TLS negotiation, or connection reuse. Compare ALB access logs with target logs.
Origin / Application
Paste a captured HTTP response or enter a status and headers. Only the status and response headers are sent; common credential headers are filtered first.
Diagnostic report
Error code / name
Fault domain
Origin / ApplicationThe load balancer connected to a target, but the target reset the connection, returned invalid HTTP, or failed a target-side TLS handshake. Idle keep-alive mismatches can close a reused connection unexpectedly.
The load balancer connected to a target, but the target reset the connection, returned invalid HTTP, or failed a target-side TLS handshake. Idle keep-alive mismatches can close a reused connection unexpectedly.
Client -> ALB -> target TCP connection -> reset or invalid response -> X 502curl -sS -v -I --connect-timeout 5 --max-time 15 --resolve app.example.com:443:TARGET_IP https://app.example.com/healthconst server = app.listen(process.env.PORT ?? 3000);
server.keepAliveTimeout = 65_000;
server.headersTimeout = 66_000;SteadyNode's multi-region probes detect recurring 502 responses and preserve timing and response headers, helping distinguish a target reset from an ALB listener change.
No credit card required.
Start for freeYes. Invalid HTTP status lines, premature closes, and protocol mismatches can prevent the load balancer from parsing a valid target response.
Yes. A target that closes a reused connection unexpectedly can cause intermittent resets; align keep-alive and idle-timeout behavior.