Nginx: upstream timed out (110: Connection timed out) while reading response header from upstream
Nginx waited longer than proxy_read_timeout (60 s default) for the backend (app server, PHP-FPM) to respond, then returned 504.
Seen on:
Nginx
Meaning
The real problem is usually a slow backend request — heavy queries, external API calls, exports — or a stuck/overloaded upstream. Raising timeouts helps only for legitimately long requests.
Common causes
- Slow application request (DB, external API)
- Backend overloaded or hung (all workers busy)
- proxy_read_timeout/fastcgi_read_timeout too low for long jobs
- Network issue to upstream
⚡ Quick fix
- Find the slow URL in error.log and optimise it
- Increase proxy_read_timeout/fastcgi_read_timeout for specific long endpoints
- Add workers / move long jobs to background queues
Detailed fix by platform
Nginx
- nginx
location /export/ { proxy_pass http://app:3000; proxy_read_timeout 300s; }
How to diagnose
- Log — Request URL and upstream in error.log
- Backend — Worker saturation, slow logs
- Timeout — Current values
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Nginx / Apache
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026