Nginx / Envoy · HTTP 504

Envoy 504: Upstream Request Timeout

Trace Envoy 504 to route deadlines, slow upstreams, retries, or downstream waits. Compare route timeout settings with application and dependency latency.

Origin / Application

Decode a CDN or gateway error

Paste a captured HTTP response or enter a status and headers. Only the status and response headers are sent; common credential headers are filtered first.

Supports raw headers, full HTTP responses, JSON with status/statusCode and headers, cURL -v/-i response output, and HAR exports. HAR selects a server error first. cURL commands are never executed; request headers, response bodies, and common credential headers are excluded.

Diagnostic report

Error code / name

ENVOY-504-UPSTREAM_TIMEOUT

Fault domain

Origin / Application

Why it happened

The upstream request did not complete before the route or per-try timeout. Repeated retries can consume the request budget and leave too little time for a useful response.

Actionable fixes

  1. Check x-envoy-response-flags, upstream service time, and route timeout for the affected request.
  2. Trace the upstream handler and its dependencies, including time spent waiting in queues.
  3. Set per-try timeouts below the route budget and avoid retrying non-idempotent requests automatically.

Why this error happened

The upstream request did not complete before the route or per-try timeout. Repeated retries can consume the request budget and leave too little time for a useful response.

Actionable fixes

  1. Check x-envoy-response-flags, upstream service time, and route timeout for the affected request.
  2. Trace the upstream handler and its dependencies, including time spent waiting in queues.
  3. Set per-try timeouts below the route budget and avoid retrying non-idempotent requests automatically.

Network failure point

Client -> Envoy -> upstream accepts request -> route deadline expires (UT) -> X 504

Verify origin directly via CLI

curl -sS -I -w 'connect=%{time_connect} starttransfer=%{time_starttransfer} total=%{time_total}\n' --max-time 90 https://api.example.com/health

Configuration fix

envoy.yamlyaml
route:
  timeout: 30s
  retry_policy:
    retry_on: connect-failure,reset
    num_retries: 1
    per_try_timeout: 10s

Catch this failure before it becomes an outage

SteadyNode's regional latency checks expose slow public endpoints before Envoy's route deadline expires and can help correlate 504 incidents with deployment changes.

No credit card required.

Start for free

Frequently asked questions

What does Envoy response flag UT mean?

UT indicates that an upstream request timed out, often because the route timeout expired before the upstream completed.

Can Envoy retries make a 504 worse?

Yes. Retries consume the same overall request budget and can add load. Use them only for safe requests and bound each attempt.

Cloudflare

Vercel and Netlify

AWS CloudFront and ALB

Fastly

Heroku and Render

Nginx and Envoy