504 Gateway Timeout
5xx Server Error
RFC 9110
Your proxy waited too long for the upstream to respond.
What 504 Gateway Timeout means {#what}
The server acting as a gateway didn’t receive a response from the upstream server in time. The upstream is alive but too slow. A timeout, not a crash.
When you’ll see a 504 {#when}
- Long-running API calls that exceed proxy timeout limits
- Slow database queries holding up the response
- Upstream service under heavy load
When to fix a 504 {#fix}
- Increase proxy timeout if the operation is legitimately slow
- Optimize the slow upstream operation
- Consider async processing for long-running tasks (respond with 202 instead)