HTTP status code 504 Gateway Timeout
HTTP 504 Gateway Timeout is the status code a proxy, load balancer or CDN returns when the upstream server behind it did not answer in time.
Fixing this error on a site, a server or an API? Step-by-step guide: 504 Gateway Timeout Fix: nginx, WordPress, AWS, Cloudflare →
Definition (RFC 9110)
HTTP status code 504 Gateway Timeout is defined in RFC 9110 (HTTP Semantics), Section 15.6.5 — the current authoritative specification for HTTP semantics, published June 2022, which obsoletes the older RFC 7231 and RFC 2616.
Description
The 504 Gateway Timeout status code indicates that the server, while acting as a gateway or proxy, did not receive a timely response from an upstream server needed to complete the request.
Common Causes
- Upstream server is slow
- Long-running database query
- Network issues between proxy and upstream
- Proxy timeout too short
How to Fix
- Increase proxy timeout values
- Optimize upstream server performance
- Check network connectivity
- Implement request queuing for long operations
Check your website's HTTP status code
Check now →