What 524 means
524 is not a standard HTTP status code; Cloudflare's edge sends it. It means Cloudflare connected to the origin and sent the request, but the origin didn't return an HTTP response before Cloudflare's proxy read timeout, which is 100 seconds by default. The connection worked; the application was just too slow.
HTTP/2 524
server: cloudflare
cf-ray: 8c1f2a3b4d5e6f70-SJC
content-type: text/html
<title>example.com | 524: A timeout occurred</title>
The origin often keeps working after Cloudflare gives up, so the task may finish (an import, an email batch) even though the visitor saw an error. Retrying can run it twice.
Common causes
- Long-running requests: reports, exports, imports, video or image processing, bulk updates done inside a single HTTP request.
- Slow database queries or lock contention that stretch a normally fast page past 100 seconds.
- A slow upstream API that the origin waits on synchronously.
- An overloaded origin where requests wait in a queue for a free worker before they even start.
How to fix it
- Find the slow requests. Your web server's access log with request times (nginx
$request_time, Apache%D) shows which URLs take close to 100 seconds. Profile them and fix the query, add caching or an index. - Move long work to the background. Have the request start a job and return at once (for example
202 Acceptedwith a job ID), then let the page poll a status URL or receive a notification when it's done. This is the durable fix. - Send a response early. A response that starts within the timeout isn't cut off by this limit, so streaming results or progress can work for tasks that must stay in one request.
- Bypass Cloudflare for long tasks. Put admin tools or batch endpoints on a hostname whose DNS record is set to DNS only (grey cloud), so requests go straight to the origin. That hostname then exposes the origin IP and loses Cloudflare's protection, so lock it down.
- Raise the timeout (Enterprise only). Cloudflare lets Enterprise plans increase the proxy read timeout (up to 6,000 seconds). On other plans the 100-second limit is fixed.
Line up the origin's own timeouts too: if nginx's proxy_read_timeout or PHP's max_execution_time is shorter than 100 seconds, the origin gives up first and you see its 504 or 502 through Cloudflare instead.
524 and SEO
Googlebot receives the 524 as a server error. A page that takes 100 seconds to render is a problem long before the timeout: Google crawls less on a slow server, and URLs that repeatedly fail are eventually dropped. Pages meant for search should answer in well under a second; keep slow work out of crawlable URLs.
Related codes
- 504 Gateway Timeout: the same idea from nginx or a load balancer.
- 522 Connection Timed Out: Cloudflare couldn't even establish the connection.
- 520 Web Server Returned an Unknown Error: the origin answered, but not with valid HTTP.
- 202 Accepted: the response for work that continues in the background.
Measure how long a URL takes with the HTTP Request Builder, or check its status through Cloudflare with the Redirect Checker.