Skip to content

Errors / HTTP errors

504 Gateway Timeout

The server in front waited for the application behind it, and gave up.

The page never arrives; for a request inside a page, a spinner that ends in nothing.

Seeing it on someone else’s site?

  • The site is too slow to answer right now; it is not your connection.
  • Try again later, or a lighter page on the same site: a 504 is often one slow page, not all of them.

Why it happens, if it is your site

  • A slow request: a heavy database query, a report, an export, a call to a slow third-party API, all inside one page load.
  • The application overloaded and queueing requests until the proxy's timeout (60 seconds on nginx by default, 100 on Cloudflare).
  • A firewall between the proxy and the app silently dropping the connection.

How to fix it

  1. Find which request is slow (the server's logs, or timing each endpoint) and make it faster, or move the work to a background job.
  2. Raise the timeout only for the endpoint that needs it (proxy_read_timeout in nginx), not for the whole site.
  3. Behind Cloudflare, anything over 100 seconds needs a background job; the limit cannot be raised on most plans.

Whose problem it is

Usually the server that answers the request.

Does your site have it?

Free, no account. We open your page and four more in a clean Chrome and list every error like this one, with the page and the click that caused it. How the free page check works.

Check only sites you run or have permission to check.

Often seen with