HTTP 504 — Gateway Timeout

The server was acting as a gateway or proxy and did not receive a timely response from the upstream server

When to use it

Use status 504 when this is the correct HTTP response semantic: The server was acting as a gateway or proxy and did not receive a timely response from the upstream server

Request and response example

GET /reports/export HTTP/1.1
Host: api.example.com

HTTP/1.1 504 Gateway Timeout

Related status codes

500, 501, 502, 503

References

MDN · RFC 9110