All HTTP status codes

HTTP 504 Gateway Timeout

Server Error

A gateway/proxy didn't get a response from the upstream in time. The upstream may still be processing — the proxy just gave up waiting.

Defined in RFC 9110

Common causes

  • Slow upstream work (long queries, external API calls) exceeding proxy timeout
  • Network path problems between proxy and upstream
  • Undersized connection pools causing queuing delays

How to fix it

  1. Profile and speed up the slow upstream operation; add DB indexes

  2. Move long work to async jobs (respond 202 + status URL)

  3. Align timeout budgets: client > proxy > upstream

  4. Check connectivity between the proxy and upstream

Want to explore status codes interactively? Try the free HTTP Status Code Reference — search, categories and example responses, right in your browser.