Skip to content
MtrXTools

504 Gateway Timeout

The server behind the proxy took too long

Seen in nginx, load balancers, CDNs

The proxy waited for the application and gave up.

Common causes

  • Slow database queries or external API calls.
  • Proxy timeout shorter than the request needs.
  • The upstream is unreachable from the proxy (firewall).

How to fix it

  1. Find and speed up the slow request; move long jobs to background workers.
  2. Raise proxy timeouts only if the work is genuinely long.
  3. Check proxy-to-upstream connectivity.
Time the response

Got a different message? Paste it into the error explainer.

Related errors

All 51 HTTP & CDN errors