Cloudflare errors

Cloudflare error 524: A timeout occurred

Cloudflare connected to the website server, but it took too long to answer.

Quick answer

A 524 means the real server accepted the connection but did not send a reply within the time Cloudflare waits. A slow task on the server is the usual reason.

When to wait: Often yes. Try again in a few minutes; if it stays, the owner must act.

If you are visiting the website

  1. Do not resend forms or payments right away A 524 means the server was still working when Cloudflare stopped waiting. Your order, upload or form may have gone through anyway. Check your email or account first, so you do not pay or submit twice.
  2. Wait a few minutes and reload once If you were just reading a page, wait a few minutes and reload once. Busy servers often recover quickly.
  3. Write down the Ray ID and the time The error page shows a 'Cloudflare Ray ID' (a code for your exact request) at the bottom. Note it with the time and what you were doing, such as 'export' or 'checkout'.
  4. Tell the website owner If the problem stays, contact the website through another channel (email or social media) and send the error code, Ray ID, page address and time.

If you run the website

  1. Find the slow requests Look for requests that take very long in your server logs. In nginx you can add $request_time to the log format to see how long each request took.
  2. Move long tasks to the background Reports, imports, exports and large uploads should run as background jobs. Answer the visitor at once with 'job started', then let the page check the status every few seconds until the result is ready.
  3. Fix the cause of slowness Check database queries, external API calls and server load at the error times. An overloaded server makes even normal pages slow enough to hit the limit.
  4. Check timeouts inside your own stack If nginx sits in front of your application, its proxy_read_timeout defaults to 60 seconds. It may cut off long requests before Cloudflare does, which shows up as a 504 instead.
  5. Use a DNS-only subdomain for unavoidable long requests Cloudflare suggests sending truly long-running requests to a subdomain set to DNS-only (grey cloud), which bypasses its timeout. That subdomain reveals your server's address and loses Cloudflare's protection, so protect it separately.
  6. Enterprise plans: raise the Proxy Read Timeout Enterprise customers can raise the wait up to 6,000 seconds with a Cache Rule or the zone settings API. On other plans, change how the application works instead.

Is it the website or me?

It is the website. The connection to the website's server worked, but the server took too long to send the page.

Your device and network are fine. The waiting happened between Cloudflare and the server.

Did my action go through?

Possibly yes. Cloudflare only stopped waiting; the server may have finished the job a moment later.

Before you try a payment or order again, look for a confirmation email or check your account. If you are unsure, ask the website's support.

How 524 differs from 522 and 504

With a 522 the server did not even accept the connection in time. With a 524 it accepted, then stayed silent too long. A 504 is the general timeout code that other proxies, or the website's own servers, return.

For developers: what happens technically

Cloudflare waits for the origin server (the website's real computer) to send an HTTP response. If none arrives within the default 125 seconds, called the Proxy Read Timeout, it returns 524.

Long synchronous requests are the usual cause. Polling a job status, or streaming progress, avoids the limit.

Common questions

Did my payment or order go through?

It might have. A 524 does not mean the server cancelled your request. Check your email and account before trying again.

How long does Cloudflare wait before showing 524?

By default 125 seconds, according to Cloudflare's documentation. Enterprise plans can raise this up to 6,000 seconds.

Can I raise the timeout on a free or standard plan?

Cloudflare documents the timeout change for Enterprise only. On other plans, run long tasks in the background or use a DNS-only subdomain for them.

Is Cloudflare down?

Usually not. Cloudflare served the error page and kept the connection open the whole time. The website's server was too slow to answer.

Likely causes

  • Common A long-running task such as a large report or import. (Website side)
  • Sometimes The server is overloaded. (Website side)

Is the website down? Check it now

One measurement point. Results explain what we saw, not a worldwide verdict.

Sources

Last reviewed: