TrueURL

504 Gateway Timeout

A gateway or proxy did not get a response from the upstream server in time, typically because the application is too slow.

Reason phrase
Gateway Timeout
Redirect
No
Cacheable by default
No

504 Gateway Timeout means a server acting as a gateway or proxy did not receive a timely response from the upstream server it needed to complete the request. The proxy waited for its configured timeout and gave up.

Unlike with 502, the upstream did not send a broken response; it sent nothing in time. Typical causes are slow database queries, long-running reports, external APIs that hang and overloaded backends. Every layer has its own limit, for example nginx's proxy_read_timeout (60 seconds by default), load balancer idle timeouts and the time limits of serverless functions.

Behind Cloudflare, an origin that accepts the connection but answers too slowly produces 524 A Timeout Occurred rather than 504.

Example response

HTTP
HTTP/1.1 504 Gateway Timeout
Date: Fri, 06 Nov 2026 10:15:32 GMT
Content-Type: text/html
Content-Length: 106

<html><body><h1>504 Gateway Timeout</h1>
<p>The upstream server did not respond in time.</p></body></html>

SEO and redirect checking

504s count as server errors: they slow down crawling and, if they persist, lead to deindexing. Slow responses also reduce how many pages Google crawls. The Redirect Latency Checker shows the time each hop takes, which helps you find slow redirects or a slow final page before they turn into timeouts.

Common causes and use cases

  • Slow database queries or long-running requests exceed the proxy timeout.
  • An external API that the application depends on does not respond.
  • The upstream server is overloaded, or the proxy cannot reach it because of DNS or network problems between them.
  • Timeouts are inconsistent across layers, so the proxy gives up before the application finishes.

URL Redirect Checker

See every status code a URL returns, hop by hop, with the free TrueURL redirect checker.