HTTP status code 504 — Gateway Timeout
Quick answer
Status code 504 (Gateway Timeout): Upstream server did not respond in time. Proxy waited too long for origin — check slow queries and timeouts.
Proxy waited too long for origin — check slow queries and timeouts.
504 is a timeout at the gateway, not necessarily a crash. Profile origin latency and align proxy idle timeouts.
Common causes
- A slow database query or long-running job blocking the response
- Proxy timeout set shorter than the origin actually needs
How to fix it
Profile what is slow on the origin (often a query) and consider raising the proxy timeout only after confirming the origin is not just hung.
Frequently asked questions
What is status code 504?
504 Gateway Timeout: Upstream server did not respond in time. Proxy waited too long for origin — check slow queries and timeouts.
When should I expect HTTP 504?
504 is a timeout at the gateway, not necessarily a crash. Profile origin latency and align proxy idle timeouts.
What usually causes HTTP 504?
A slow database query or long-running job blocking the response; Proxy timeout set shorter than the origin actually needs.
How do I fix HTTP 504?
Profile what is slow on the origin (often a query) and consider raising the proxy timeout only after confirming the origin is not just hung.
Where can I see all status codes?
Open the HTTP status codes hub on TryDevSnip for the full reference list.
Does TryDevSnip log my API traffic?
No. These pages are static reference. TryDevSnip does not proxy or inspect your HTTP calls.