HTTP status code · RFC 9110, section 15.6.5

504 Gateway Timeout

504 Gateway Timeout means a proxy or gateway didn't get a response from the upstream server in time.

What 504 means

The proxy reached your app but the app took longer than the proxy's timeout. The app may still be working on the request.

Common causes

  • Slow database queries or external API calls.
  • An overloaded app with requests queuing up.
  • A proxy timeout set shorter than a slow endpoint needs.

How to fix 504

  • Find the slow part (query, external call) with logs or tracing.
  • Move long work to a background job and return early.
  • Only then consider raising the proxy timeout.

How Uptenna treats 504

With the default expected status (200-399), a 504 counts as a failed check. Two failures in a row open an incident, and the alert says Got HTTP 504 (expected 2xx or 3xx). The first successful check resolves it and sends a recovery. If the server doesn't answer at all within the monitor's timeout (10 seconds by default), the check fails with “Timed out” instead.

See Monitors for expected status codes, keywords and timeouts.

Frequently asked questions

What does HTTP 504 mean?

504 Gateway Timeout means a proxy or gateway didn't get a response from the upstream server in time.

Is 504 an error?

Yes, 504 is a server error: the problem is on the server's side (or something between the client and the server).

Does an uptime monitor treat 504 as down?

By default, yes: Uptenna counts anything outside 200-399 as a failed check and opens an incident after two failures in a row. You can change the expected status per monitor.

Related status codes

Find out the moment your site returns 504

Uptime checks, cron job heartbeats and a public status page, with an alert when something breaks. Free: 5 monitors checked every 5 minutes and email alerts. Pro ($9/month): checks every minute, Slack, Discord, Telegram and webhooks, SSL expiry warnings.

  • No card required
  • Status page included
  • Email alerts included