Error reference HTTP status

504 Timeout Error: find the hop that gave up waiting

A 504 means a server in the middle of your request chain — a load balancer, CDN edge, reverse proxy, or your forward proxy — forwarded your request onward and never got a timely reply. The origin is slow or unreachable, not refusing. Fixing it starts with identifying which intermediary timed out, because that decides whether the problem is yours to solve.

504 Timeout Error

What a 504 error means

Modern requests rarely go straight to the application. They pass through intermediaries — CDN edges, load balancers, reverse proxies like nginx, and sometimes your own forward proxy. A 504 is minted by one of those intermediaries when it forwarded your request to the next server in the chain and hit its own internal timeout before any response came back. Contrast that with a 502, where a response arrived but was invalid: with a 504, nothing arrived at all.

In the overwhelming majority of cases the slow party is the target's own backend: a database query that runs too long, an application server with a saturated worker pool, an API aggregating slow downstream calls, or an origin drowning under load. That means most 504s are target-side and transient — the same request often succeeds seconds later.

The important diagnostic detail is who served the error page. A branded CDN or load-balancer error page means the timeout fired inside the target's own infrastructure. A generic response from your forward proxy means the target never answered your proxy at all — a different problem with a different fix.

504 Timeout Error

How to fix a 504, step by step

Start with the cheap checks that establish whose timeout fired, then reduce the load and latency you contribute to the chain.

  1. Retry after 5–15 seconds. Backend slowness is spiky; a single retry with a short delay resolves a large share of 504s without any other change.
  2. Load the same URL without your proxy, from a browser or another network. If it still returns 504, the target's own infrastructure is timing out and your job is to wait and retry politely.
  3. Read the error page itself. CDN- or load-balancer-branded pages place the timeout inside the target's stack; an unbranded plain response points at an intermediary closer to you.
  4. Reduce concurrency against the target. Ten parallel hits on an expensive endpoint can back up its workers until every request exceeds the timeout — including yours.
  5. Request cheaper work: tighter query parameters, smaller page sizes, fewer filters. Endpoints that trigger heavy searches or reports are chronic 504 producers under load.
  6. Set your client timeout longer than the intermediary's (60–120 seconds is safe). Otherwise you abort first and log a client-side timeout, hiding the real status you would have received.
  7. Check the target's status page or recent incident history — sustained 504s across many URLs usually mean a degraded backend, and no client-side change will fix that.
  8. If the error only appears through your proxy, switch to an exit location closer to the target to cut round-trip latency, and retry through a fresh exit IP.
504 Timeout Error

504s through a proxy: which timer fired?

Adding a forward proxy adds one more hop that can time out and one more place the error can originate. When a target's origin stalls, its own load balancer serves the 504 and your proxy just relays it — the proxy changed nothing. But if the target never answers the proxy at all, the proxy eventually gives up and reports the failure itself. Telling these apart is the whole diagnosis: the first is the target's problem, the second is about the path between your exit IP and the target.

Path problems respond to proxy configuration. An exit on another continent adds hundreds of milliseconds each way, which matters when the origin is already near its timeout budget. An exit IP that the target's edge deprioritizes or tarpits can stall indefinitely. Choosing a nearby, reputable exit shortens the path, and rotation ensures a retry doesn't re-use a stalled route.

Pick an exit near the target

ProxyOmega supports country targeting across 200+ countries by appending -country-us (or any country code) to the proxy username, and Platinum adds state, city, and ASN precision. A same-region exit trims round-trip latency — often the margin between a slow success and a 504 on an origin near its limit.

Keep retries on fresh paths

Budget Unlimited rotates each port's exit on an interval, so a retry after a 504 naturally leaves from a different residential IP and route instead of re-hitting a stalled one. If you need the same IP across a multi-step flow, sticky sessions via -session-<id> hold it for up to 24 hours.

Give heavy jobs dedicated speed

Large page bodies and slow transfers keep connections open longer and flirt with intermediary timeouts. Premium Unlimited provides dedicated 200 Mbps–1 Gbps residential bandwidth, so big responses complete quickly instead of stalling behind shared capacity.

504 Timeout Error

A curl setup that surfaces the real timeout

This bash example sets client timeouts longer than typical intermediary limits so you see the genuine 504 instead of a local abort, retries transient failures with spacing, and prints timing so you can tell a slow success from a stall.

PROXY="http://username-country-us:[email protected]:10000"

curl -x "$PROXY" \
  --connect-timeout 15 \
  --max-time 120 \
  --retry 3 --retry-delay 10 --retry-all-errors \
  -w "status=%{http_code} connect=%{time_connect}s total=%{time_total}s\n" \
  -o response.html \
  "https://example.com/search?q=widgets"
FAQ

Frequently asked questions

Is a 504 caused by my proxy or by the website?
Usually the website: its own load balancer or CDN edge timed out waiting for a slow origin, and your proxy just passed the error along. To confirm, request the same URL without the proxy — an identical 504 settles it. Suspect the proxy path only when the error disappears off-proxy or arrives with no target branding on the error page.
What's the difference between a 502 and a 504?
Both come from an intermediary that couldn't get a usable answer from the server behind it. With a 502, a response arrived but was invalid or malformed; with a 504, no response arrived before the intermediary's timeout expired. In practice 504 points at slowness or overload, while 502 points at a crashing or misbehaving backend process.
Will increasing my timeout settings fix a 504?
Not directly — the timeout that fired lives on a server you don't control, so no client setting changes it. But your client timeout should still exceed the intermediary's (60–120 seconds), otherwise you disconnect first and never see the true status code, which makes diagnosis guesswork. Real fixes come from retries, lower concurrency, and cheaper requests.
Does rotating proxies help with 504 errors?
It helps when the stall is path- or IP-specific: a retry from a fresh exit avoids a tarpitted address or a bad route, and a closer country cuts latency on origins near their timeout budget. It doesn't help when the origin itself is overloaded — every visitor times out equally, and only backoff and patience work there.

Retries deserve a fresh route. Start routing today.

ProxyOmega rotates residential exits across 200+ countries — with sticky sessions when you need the same IP to finish the job.

ProxyOmega ProxyOmega

90M+ ethically-sourced IPs across 200+ countries and 30,000+ cities. Residential, mobile, ISP and IPv6 proxies for scraping and AI agents.

GDPRCCPA
Product
Premium Unlimited Budget Unlimited Residential / ISP Mobile IPv6 Chrome Extension
Solutions
Web scraping AI agents Price monitoring SERP & SEO Integrations All use cases
Resources
Glossary Error codes Free tools Proxies by platform Locations
Company
About Blog Docs Reseller program Affiliate Contact Sign in
© 2026 ProxyOmega Ltd. All rights reserved.