NGINX ingress returns 504 and logs `upstream timed out (110: Connection timed out) while reading response header from upstream`.
BeginnerTroubleshootingReliability Patterns in Production
Answer
Likely causes → The backend did not respond within proxy-read-timeout (default 60s): slow queries, a hung dependency, or a long-running endpoint that should be async.
Diagnose →
kubectl logs -n ingress-nginx deploy/ingress-nginx-controller | grep "upstream timed out" | tail
kubectl get ingress -n shop checkout -o yaml | grep -i timeout
Check the backend's latency and dependency traces for those requests.
Fix → Fix the slow backend path (timeouts on its dependencies, indexes, async jobs). Only raise nginx.ingress.kubernetes.io/proxy-read-timeout for endpoints that legitimately take long.
Prevent → Nest timeouts: backend dependency timeouts < backend request timeout < ingress timeout < client timeout.
More on Reliability Patterns in Production
Clients get 503s with body `upstream connect error or disconnect/reset before headers. reset reason: overflow`, and Envoy logs show flag `UO`.AdvancedAfter a 30-second database blip, Postgres keeps rejecting connections with `FATAL: sorry, too many clients already` for 20 minutes.AdvancedCustomers were charged twice during an incident where the payment API timed out.AdvancedEvery rolling deploy produces a short burst of 502s on the AWS ALB.IntermediateRedis restarted and immediately the database CPU hit 100% and the site went down.AdvancedLogs fill with `CallNotPermittedException: CircuitBreaker 'inventory' is OPEN and does not permit further calls` long after inventory recovered.Intermediate