Cloudflare Error 524: A timeout occurred while waiting for the origin

Cloudflare connected to the origin successfully, but the origin took longer than 100 seconds to send a complete response. The request is too slow, not unreachable.

Short answer

Cloudflare connected to the origin successfully, but the origin took longer than 100 seconds to send a complete response. The request is too slow, not unreachable.

What Cloudflare Error 524 means

524 is a response-time limit, not a connection failure. It fires on long-running requests: heavy reports, unbatched imports, slow third-party API calls inside the request path.

Causes and fixes, most likely first

  1. A single request genuinely takes longer than 100 seconds. Move the work to a background job and return immediately with a status the client can poll. Long synchronous requests are fragile regardless of the CDN.
  2. A slow external API call blocks the response. Set an aggressive timeout on outbound calls and degrade gracefully rather than blocking the whole response.
  3. Database queries without indexes are slow under load. Profile the slow endpoint and add the missing indexes. 524s that appear only at peak are usually query-plan problems.

Cloudflare Error 524 on specific platforms

How to stop it happening again

Check your own domain

An external probe reports actual response time, which tells you how close normal requests are running to the limit before they tip over.

Frequently asked questions

Can I raise the 524 timeout?

Enterprise plans can extend it, but the durable fix is making the request finish faster or moving the work to a background job.