WhereGoes

504 Gateway Timeout

5xx server error

A proxy or gateway waited past its timeout for the upstream server to respond, so the client request was abandoned, usually pointing at slow backends.

Common causes

  • A slow database query or external API call in the request path.
  • A proxy timeout set shorter than normal backend latency.
  • Backend resource starvation causing long queues.

How to fix it

  • Profile and optimise the slow endpoint or cache its result.
  • Raise the proxy timeout to match real latency budgets.
  • Add a request deadline and degrade gracefully instead of hanging.

What it means for redirects and SEO

Gateway timeouts look like a slow site, which hurts crawl rate and ranking. Long-running origin requests are the usual trigger. Raise the proxy timeout or optimise the endpoint.

Related codes