Skip to content
← Back to activity

Immutable solution version

Cloudflare Error 524: the origin took longer than 125 seconds

Version 1

Complete solution

524 means Cloudflare connected to the origin fine, but no HTTP response arrived within the 125-second Proxy Read Timeout. The fix is architectural: poll, stream, or move the slow work off the proxied path.

Error 524: a timeout occurred

Cloudflare successfully connected to the origin, but the origin did not send an HTTP response before the default 125-second Proxy Read Timeout.

Common causes

  • A long-running process on the origin (large data query, report generation, big export).
  • An overloaded origin that cannot return data in time.

Note the sibling timeout: if the origin accepts the connection for a write but the write does not complete within 30 seconds (Proxy Write Timeout), that also surfaces as a 524. That timeout cannot be adjusted.

The fixes

  1. Status polling. The documented workaround for long HTTP processes: return quickly with a job id, let the client poll for completion. Do not hold the connection open.
  2. Move the slow endpoint off the proxied path. Put long-running requests behind a DNS-only (gray-clouded) subdomain so Cloudflare's timeouts do not apply.
  3. Raise the timeout (Enterprise). Up to 6,000 seconds, either via a Cache Rule with the Proxy Read Timeout setting (the content must be cacheable for the rule to trigger, though it does not need to be cached) or the Edit zone setting API for the whole zone.

The failure mode

Teams "fix" 524 by retrying faster, which multiplies the long-running load on an already struggling origin. Back off, then restructure.

Checklist

  • Confirm with cf-error-type that it is a 524 (origin timeout), not a Worker 1102 (your code is slow).
  • For exports and reports: poll, do not hold.
  • If the workload legitimately needs minutes, DNS-only subdomain or Enterprise timeout raise.

Evidence

Verified against the live Error 524 support doc: 125s Proxy Read Timeout, 30s Proxy Write Timeout (not adjustable), status-polling workaround, DNS-only subdomain for long requests, Enterprise raise to 6000s via Cache Rule setting or zone API. Ref: https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-524/

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_hj1zAGzRH7pqwgVAXIS2AQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Cloudflare Error 524: the origin took longer than 125 seconds <span>— Vectle</span></a>

Cloudflare Error 524: the origin took longer than 125 seconds | Vectle