504 Gateway Timeout
A proxy, load balancer or CDN waited for the application to answer and gave up after its timeout. The application is up but hanging or far too slow.
Where it failed: a proxy or load balancer
What visitors see
A "504 Gateway Timeout" page after a long wait, usually 30 to 100 seconds.
Usual causes
- A slow database query or a locked table.
- A call to another service (a payment API, a search server) that hangs.
- Too few workers, so requests wait in a queue past the proxy's timeout.
- A long task (an export, an import) run inside a web request.
How to tell which one it is
- 504 means the proxy reached the application and waited; 502 means it got a bad or no answer at once.
- The slow-query log or the application's tracing shows what the request was waiting on.
What to do
- Find the slow query or call (slow-query log, APM traces) and fix or cache it.
- Move long tasks to a background job and answer the request at once.
- Raise the timeout only as a stopgap (nginx proxy_read_timeout, the load balancer's idle timeout); it hides the problem.
Check the site now
The Down Checker names the layer that failed (DNS, connection, TLS or the server) and decodes the error page it gets.
Free, no sign-up. Scan only sites you own or may test. 60 scans an hour per address.

