HTTP status code

HTTP 504 Gateway Timeout

504 Gateway Timeout means an intermediary server waited too long for a response from the backend (origin) server.

Reviewed: 6 November 2026
Class
5xx · Server errors
Where the problem is
Problem on the website's server
Who fixes it
The site owner has to fix it.

What it means

A 504 involves two servers: a proxy, CDN or load balancer receives the request and forwards it to the backend, which doesn't respond within the timeout. With a 502 the backend response is invalid; with a 504 it doesn't arrive in time at all.

Most common causes

  • A slow database query or long-running task.
  • An overloaded backend server.
  • A proxy timeout set too low (proxy_read_timeout).
  • A network problem or firewall between the proxy and the backend.
  • Backend DNS not pointing at the right server.

What you can do as a visitor

  1. Refresh the page after a minute or two.
  2. Check whether the site works for others.
  3. If it's your own router or a local proxy, restart it.

Shows the HTTP status, redirect chain, HTTPS and basic SEO signals. Works for public addresses only.

What the site owner or developer should do

  1. Search the proxy and backend logs for requests that exceed the timeout.
  2. Optimise slow queries and move long tasks to the background (job queues).
  3. If needed, increase proxy timeouts moderately.
  4. Make sure the backend accepts connections from the proxy's IPs.

Impact on SEO and Google

Occasional 504s do no harm. Recurring 504s point to a slow backend, which slows crawling and hurts the user experience.

Frequently asked questions

What's the difference between 502 and 504?

502: the backend returned an invalid response. 504: the backend didn't respond in time.

Is a 504 caused by my internet connection?

Almost never. The problem is between the website's servers.

Sources