upstream timed out 🖥️ Nginx / Apache

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

  1. Find the slow URL in error.log and optimise it
  2. Increase proxy_read_timeout/fastcgi_read_timeout for specific long endpoints
  3. Add workers / move long jobs to background queues

Detailed fix by platform

Nginx

  1. nginx
    location /export/ {
        proxy_pass http://app:3000;
        proxy_read_timeout 300s;
    }

How to diagnose

  1. Log — Request URL and upstream in error.log
  2. Backend — Worker saturation, slow logs
  3. 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:

🧠 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.