SiteError.comYour friendly guide to HTTP status codes
Status CodesBlog
  1. Home
  2. Blog
  3. Understanding Cloudflare 524 A Timeout Occurred: When Your Origin Connects but Never Answers

Understanding Cloudflare 524 A Timeout Occurred: When Your Origin Connects but Never Answers

October 12, 20268 min read
Cloudflare

524 A Timeout Occurred is Cloudflare's way of saying the origin server picked up the phone and then went silent. This isn't a connection problem — Cloudflare and your origin shook hands just fine. The origin simply took too long to say anything back. This post covers what 524 actually means, why it's a completely different failure from 522 (which never even connects), how it compares to the standard 504 Gateway Timeout, and what to do about it — on your origin and on Cloudflare's side.

What Is a 524?

524 is Cloudflare-proprietary — it appears in no RFC and isn't in the IANA HTTP status code registry. It's part of Cloudflare's extended 52x error series, generated only when a site sits behind Cloudflare's proxy.

Cloudflare's own documentation defines it plainly:

Error 524 indicates that Cloudflare successfully connected to the origin web server, but the origin did not provide an HTTP response before the default 120 seconds Proxy Read Timeout. — Cloudflare's documentation, Error 524: a timeout occurred

In plain English: the TCP connection succeeded, Cloudflare sent the request, and then it waited — and waited — for a response that never came in time. By the time Cloudflare gives up and returns a 524, your origin may still be chugging away on that request; Cloudflare has simply stopped waiting for it.

Cloudflare's docs also note a second, less common path to the same status code:

Error 524 can also indicate that Cloudflare successfully connected to the origin web server to write data, but the write did not complete before the 30 seconds Proxy Write Timeout (or 6.5 seconds in the case of Cloudflare Images). This timeout cannot be adjusted. — Cloudflare's documentation, Error 524: a timeout occurred

That's a narrower case — Cloudflare failing to finish sending data to the origin — but the visible symptom is the same 524.

The Timeout Window, and Who Can Change It

The default read timeout is 120 seconds, per Cloudflare's current documentation — not the shorter or longer figures you may have seen quoted elsewhere; timeout defaults are exactly the kind of number that drifts as Cloudflare's platform evolves, so it's worth confirming against the live docs rather than a cached memory of them. Free, Pro, and Business plans are stuck with that 120-second ceiling. Cloudflare's docs describe two ways an Enterprise plan can raise it:

Enterprise customers can increase the 524 timeout up to 6,000 seconds — Cloudflare's documentation, Error 524: a timeout occurred

via a Cache Rule that sets the Proxy Read Timeout setting (the response has to be cacheable for the rule to trigger, though it doesn't need to actually be cached), or by adjusting the proxy_read_timeout setting for the whole zone through Cloudflare's Edit Zone Setting API. Below Enterprise, there's no dashboard toggle for this — the 120-second wall is fixed.

524 vs 522 vs 504

Three codes describe origin communication failing at different stages, and mixing them up sends you troubleshooting the wrong layer:

CodeMeaningWhat happenedStandard?
522 Connection Timed OutCloudflare couldn't even establish a TCP connection to the origin within its timeoutThe origin never picked upNo (Cloudflare-specific)
524 A Timeout OccurredCloudflare connected fine, but the origin didn't respond before the read/write timeoutThe origin picked up, then went quietNo (Cloudflare-specific)
504 Gateway TimeoutThe standard proxy-timeout code; any gateway can return it when an upstream is too slowDepends on the proxy — could mean either of the aboveYes (RFC 9110)

The mental model: 522 is "nobody answered the phone," 524 is "they answered and then put the phone down without hanging up." If you're chasing 522s, the origin's network path or listening service is the problem. If you're chasing 524s, the origin received the request and is doing real work — the problem is how long that work takes, or how the origin behaves once it starts responding.

504 sits above both as the generic, RFC-defined signal any reverse proxy uses for "upstream too slow." Cloudflare's own 52x family exists precisely to be more specific than a bare 504 — 524 tells you where in the request lifecycle the origin stalled, which narrows your search considerably before you ever open a log file.

Common Causes

Cloudflare's documented causes for 524, plus the patterns operators report most often:

  1. A long-running process on the origin. A large data export, an expensive report generation, or a slow aggregate query that legitimately takes longer than the read timeout to finish.
  2. An overloaded origin. The server is CPU- or connection-starved and can't get to processing the request in a timely way, even though it accepted the TCP connection.
  3. Large file uploads or downloads that stall mid-transfer, tripping the write timeout rather than the read timeout.
  4. Streaming responses that pause. If the origin starts a response and then stalls (rather than closing the connection), Cloudflare's clock is still running against it.

Mitigating 524

Fix the origin first

The core problem is almost always that some request path is slower than Cloudflare's patience. Cloudflare's own recommendation is straightforward:

Implement status polling of large HTTP processes to avoid hitting this error. — Cloudflare's documentation, Error 524: a timeout occurred

That's the same pattern this site's 202 Accepted post covers in depth: instead of making the client wait on a synchronous request that might take 3 minutes, return 202 immediately with a status URL, do the slow work in the background, and have the client poll (or get a webhook) for the result. A request that finishes in 200ms can't time out — moving the actual long-running work off the request/response cycle sidesteps the 120-second ceiling entirely rather than fighting it.

For everything else, Cloudflare's documentation also suggests logging request-response time at the origin (via Apache's or NGINX's own logging) to identify exactly which resource is slow, and checking whether the origin is simply under-provisioned for its load.

Bypass the proxy for known-slow routes

If you regularly run requests that legitimately take longer than 120 seconds — bulk exports being the classic example — Cloudflare suggests moving that specific subdomain out of the orange-clouded proxy entirely (DNS-only / grey-clouded), so Cloudflare's proxy timeout doesn't apply to it at all. That trades away Cloudflare's caching, WAF, and DDoS protection for that one hostname, so it's a targeted move, not a default.

Diagnose before you guess

Cloudflare's dashboard offers Origin Analytics specifically for this:

Use Origin Analytics to monitor origin response times and catch requests approaching your timeout threshold before they result in 524 errors. If P95 response times are near the Proxy Read Timeout, identify the slow paths in the Top endpoints table and optimize them — or increase the timeout for Enterprise zones. — Cloudflare's documentation, Error 524: a timeout occurred

That's the tool to reach for before assuming which endpoint is at fault — a P95 response time creeping toward 120 seconds on a specific route is a much stronger signal than a raw count of 524s.

Common Pitfalls

  1. Reflexively raising the timeout instead of fixing the slow path. Even where you can raise it (Enterprise), a 6,000-second timeout on a synchronous HTTP request is rarely the right design — it just means your users (or their client's own timeout) give up long before Cloudflare does.
  2. Confusing 524 with 522 during triage. They point at opposite ends of the connection lifecycle — one at the TCP handshake, one at the response — and the fixes don't overlap. Check which one you're actually seeing before changing anything.
  3. Assuming a lower-tier plan can raise the 120-second ceiling. The Cache Rule and zone-setting workarounds for extending the timeout are Enterprise-only; Free, Pro, and Business are fixed at 120 seconds no matter what dashboard setting you go looking for.
  4. Ignoring the write-timeout path. Not every 524 is a slow response — some are Cloudflare failing to finish sending data to the origin within 30 seconds (6.5 for Cloudflare Images), a fixed limit that isn't adjustable on any plan.

Wrapping Up

524 tells you something specific: the origin was reachable and it accepted the request, but it didn't answer inside Cloudflare's patience window. The rules of thumb:

  • 524 is Cloudflare-proprietary — not in any RFC, not in the IANA registry
  • The default read timeout is 120 seconds; only Enterprise plans can raise it (up to 6,000 seconds), via a Cache Rule or the zone API
  • 522 means the origin never connected at all; 524 means it connected and then went quiet — different problems, different fixes
  • The durable fix for long-running work is async processing with status polling, not a bigger timeout

For more, see our pages on 524 A Timeout Occurred and 522 Connection Timed Out, our 504 Gateway Timeout post for the standard proxy-timeout code, our 202 Accepted post for the async/polling pattern, and the rest of the Cloudflare-specific codes.

Full Reference

524 A Timeout Occurred

Cloudflare completed a TCP connection but the origin did not reply with an HTTP response before timing out.

Related Status Codes

🤷520Web Server Returns Unknown Error🚫521Web Server Is Down⏱️522Connection Timed Out🗺️523Origin Is Unreachable🕐524A Timeout Occurred🔐525SSL Handshake Failed📜526Invalid SSL Certificate🚂527Railgun Error
Back to Blog

Popular Status Codes

  • 200 OK
  • 301 Moved Permanently
  • 302 Found
  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable

Compare Codes

  • 401 vs 403
  • 301 vs 302
  • 404 vs 410
  • 500 vs 502
  • Compare any codes →

Categories

  • Informational
  • Success
  • Redirection
  • Client Error
  • Server Error
  • NGINX
  • Cloudflare
  • AWS ELB
  • Microsoft IIS

Tools

  • Cheat Sheet
  • Status Code Quiz
  • URL Checker
  • API Playground
  • Blog

© 2026 SiteError.com. All rights reserved.