Some requests through an ALB fail with HTTP `463`.
AdvancedTroubleshootingLoad balancers and reverse proxies
Answer
Likely causes → The ALB received an X-Forwarded-For header with more than 30 IP addresses. This happens when requests loop through proxies (a CDN → proxy → ALB → app that calls back into the same ALB), each hop appending an IP, or when a misbehaving client sends a huge header.
Diagnose →
# in ALB access logs, find the client and path
grep ' 463 ' alb.log | awk '{print $4, $13}' | sort | uniq -c
# reproduce
curl -s -o /dev/null -w '%{http_code}\n' -H "X-Forwarded-For: $(seq -s, 1 31 | sed 's/[0-9]*/1.1.1.1/g')" https://app.example.com/
Fix → Break the request loop (an app calling its own public URL, or a redirect chain between proxies) and make intermediate proxies replace instead of append untrusted XFF values.
Prevent → Map the request path through CDN/proxies/LBs and avoid hairpinning internal calls through the public entry point.
More on Load balancers and reverse proxies
nginx returns `502 Bad Gateway` and the error log says `connect() failed (111: Connection refused) while connecting to upstream`.Beginnernginx returns `504 Gateway Time-out` with `upstream timed out (110: Connection timed out) while reading response header from upstream`.BeginnerAn ALB target group shows all targets `unhealthy` with `Health checks failed with these codes: [404]`.BeginnerAn ALB returns sporadic `502`s, and access logs show `elb_status_code=502` with `target_status_code=-`. Load is low.Intermediatenginx logs `upstream prematurely closed connection while reading response header from upstream`.Intermediatenginx error log shows `no live upstreams while connecting to upstream` and every request gets 502.Intermediate