504 504 Gateway Timeout

The server did not receive a timely response from an upstream server.

When you'll see it

When a proxy, load balancer or CDN waited too long for the server behind it. The server may still be working on the request.

What to check

  • The difference from 502: a 504 means no answer came in time, while a 502 means the answer was bad.
  • Slow database queries and calls to outside services, which are the usual cause.
  • The proxy's timeout. Raising it only hides the problem if the request is really too slow.
  • Move long jobs to a background queue, and answer right away.

Example response

HTTP/1.1 504 Gateway Timeout
Server: nginx
Content-Type: text/html

SEO impact

Same as 502. It usually indicates a slow backend or misconfigured timeouts. Persistent 504s hurt crawl budget.

At a glance

Status code504
Group5xx Server Errors
Class5xx