5xx Server ErrorHTTP Status Code Reference
HTTP 504 Gateway Timeout— What It Means, Causes & How to Fix It
The server, while acting as a gateway or proxy, did not get a response in time from the upstream server. The backend took too long to respond, and the gateway gave up waiting.
Live URL Status Checker
Enter any URL to see its real HTTP response code
Common Causes
- Backend server is too slow to respond
- Long-running database query or computation
- Network latency between proxy and backend
- Upstream server is deadlocked or hung
How to Fix
- 1Increase gateway/proxy timeout settings
- 2Optimize slow backend operations and database queries
- 3Add caching to reduce backend load
- 4Break long operations into async jobs returning 202
Example
HTTP 504 Gateway Timeout
GET /api/report HTTP/1.1 → Nginx (proxy, 30s timeout) → Backend takes 60s to generate report → 504 Gateway Timeout
Related Server Error Codes
Commonly Referenced Status Codes
The most frequently searched HTTP status codes