Skip to content
5xx · Server Error

504 Gateway Timeout

A gateway server did not receive a timely response from the upstream server.

What it means

HTTP 504 Gateway Timeout means a proxy or gateway server did not get a response from the upstream server in time. Unlike 502, where the upstream replied with something invalid, here the upstream simply did not respond before the timeout.

When it happens

It happens with slow backend processing, an overloaded origin, long-running database queries, or upstream timeouts set too aggressively at the proxy or load balancer.

How to fix it

  • Investigate slow backend operations and optimize long-running queries.
  • Increase upstream timeout settings on the gateway or load balancer if work is legitimately slow.
  • Scale or add caching to reduce backend load.
  • Check the health and capacity of the origin server.

SEO impact

Damaging if sustained. Timeouts prevent indexing and, when repeated, slow your crawl rate and risk ranking loss. Keep server response times well within gateway timeouts.

Check it with Sitewell

Find out which of your URLs return 504

Paste a list of URLs and Sitewell checks the status code of every one at once — free and without signup.

Related codes

Related guides