// http 5xx · server error

HTTP 504 Gateway Timeout

An upstream server didn't respond in time.

What HTTP 504 Gateway Timeout means

504 Gateway Timeout means a proxy or gateway didn't get a response from an upstream server in time. Like 502 it's about the upstream, but here the upstream was too slow rather than broken.

Which category is it?

504 is a 5xx code — Server error. 5xx means the server failed to fulfil an apparently valid request. It's the server's responsibility, not the caller's.

Common causes

  • An upstream service responding too slowly
  • A long-running query or request exceeding the timeout
  • Network issues between proxy and origin

How to fix it

  • Speed up or optimise the slow upstream operation
  • Raise the gateway timeout if the work is legitimately long
  • Check connectivity between the proxy and origin

Other server error (5xx) codes