Skip to content

504 Gateway Timeout ​

Meaning ​

The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server. Essentially, the upstream server failed to send a request in time.

When to Use ​

When a server is acting as a proxy or gateway and a request to the upstream takes too long or times out, so the intermediary gives up waiting and returns this error to the client.

Example ​

A CDN or reverse proxy tries to call an API service, but the API is slow and doesn’t respond within the timeout window; the client receives 504 Gateway Timeout from the proxy indicating the upstream took too long.

When Not to Use ​

Do not use if your server is not a gateway or proxy. If your own server's processing times out internally, you might still use 503 or a custom scheme. 504 is specifically for timeouts in communication with another server.

Source ​

RFC 9110


Released under the MIT License.