HTTP 504 — Gateway Timeout
Category: HTTP | Priority: High
What does HTTP 504 Gateway Timeout mean?
A gateway or reverse proxy did not receive an upstream response within its configured timeout period.
Likely causes of HTTP 504
- An application backend responding too slowly
- Long database queries or blocked dependencies
- Proxy or load balancer timeouts shorter than the expected request time
- Network interruptions between proxy and application server
How to diagnose and fix HTTP 504
- Record the affected URL, exact time and how long the timeout takes.
- Measure the backend response time directly from the proxy host.
- Inspect slow database queries, queue backlogs and third-party services.
- Compare proxy, application and load-balancer timeout thresholds.
- Fix bottlenecks before increasing limits, then retest.
Increasing proxy timeouts without fixing a slow backend may conceal the problem rather than resolve it.
Return to the HTTP error code reference.
HTTP 504 vs 502: what is the difference?
HTTP 504 indicates that an upstream response did not arrive in time. HTTP 502 indicates that the response received by the gateway was invalid or unusable. Inspect logs to tell a timeout from a broken upstream connection.