HTTP 504 Gateway Timeout vs 524 A Timeout Occurred
Both HTTP 504 (Gateway Timeout) and 524 (A Timeout Occurred) belong to the 5xx Server Error category. 504 indicates that the server, acting as a gateway or proxy, did not receive a timely response from the upstream server. Meanwhile, 524 means that cloudflare-specific. A TCP connection was established but the origin didn't respond with an HTTP response in time.
Description
The server, acting as a gateway or proxy, did not receive a timely response from the upstream server.
When You See It
When an upstream server is too slow to respond within the proxy's timeout window.
How to Fix
Increase proxy timeout settings. Optimize upstream server performance. Check for long-running queries.
Description
Cloudflare-specific. A TCP connection was established but the origin didn't respond with an HTTP response in time.
When You See It
When a request to the origin takes longer than Cloudflare's 100-second timeout.
How to Fix
Optimize slow endpoints. Move long-running tasks to background jobs.
Key Differences
HTTP 504: The server, acting as a gateway or proxy, did not receive a timely response from the upstream server.
HTTP 524: Cloudflare-specific. A TCP connection was established but the origin didn't respond with an HTTP response in time.
You encounter 504 when when an upstream server is too slow to respond within the proxy's timeout window.
You encounter 524 when when a request to the origin takes longer than Cloudflare's 100-second timeout.
When to Use Which
For 504 (Gateway Timeout): Increase proxy timeout settings. Optimize upstream server performance. Check for long-running queries. For 524 (A Timeout Occurred): Optimize slow endpoints. Move long-running tasks to background jobs.