HTTP status codes / 5xx — Server error
504 Gateway Timeout
What it means
A proxy gave up waiting for the upstream server to respond. The backend is alive but too slow.
What causes it
Slow database queries, upstream calls without timeouts, undersized backends, proxy timeout set below real request duration.
How to fix it
Operators: find the slow operation behind the endpoint (usually a query) — raising the proxy timeout hides the symptom, it does not cure it. Long-running work belongs in async jobs, not request handlers.