nginx
proxy_error
ai_generated
true
upstream timed out (110: Operation timed out) while reading response header from upstream, client: 10.0.0.1, server: example.com
ID: nginx/proxy-read-timeout
82%Fix Rate
87%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1 | active | — | — | — |
Root Cause
504 Gateway Timeout. Backend did not send response headers within proxy_read_timeout (default 60s). Long-running request or backend issue.
genericWorkarounds
-
88% success Increase proxy_read_timeout for specific slow endpoints only
location /api/reports { proxy_read_timeout 300s; proxy_pass http://backend; } # only slow endpoints get longer timeoutSources: https://nginx.org/en/docs/http/ngx_http_core_module.html
-
92% success Fix the slow backend response (optimize query, add caching)
Profile backend: slow query log, APM tracing. Add caching for expensive operations. 504 means the backend is too slow.
-
82% success Implement request buffering and async processing for long operations
Return 202 Accepted immediately; process in background; client polls /status endpoint. Avoids tying up nginx and backend workers.
Dead Ends
Common approaches that don't work:
-
Set proxy_read_timeout to 3600 or higher globally
75% fail
Extremely long timeouts mask backend failures and tie up nginx worker connections for the duration. Set per-location for specific slow endpoints.
-
Add keepalive connections assuming the timeout is a connection issue
80% fail
proxy_read_timeout is about response time, not connection establishment. Keepalive helps with proxy_connect_timeout, not read timeout.