504 Gateway Timeout

A gateway or proxy did not get a response in time from the server behind it.

What to do

A proxy or gateway waited for the server behind it and gave up. Make the upstream answer sooner, or raise the proxy's timeout. In nginx that is proxy_read_timeout, 60 seconds by default.

Class
5xx Server Error. The server failed to fulfill a request that looked valid.
Registered
Yes, in the IANA HTTP status code registry.
Cacheable by default
No. A cache stores it only when Cache-Control or Expires says to.
References
RFC 9110 ยง15.6.5 · MDN

Every 5xx code

All HTTP status codes, in one table