Cloudflare Error 524 (A Timeout Occurred): Causes and How to Fix It
Quick Answer: What Is Cloudflare Error 524?
Cloudflare Error 524 (A Timeout Occurred) is an HTTP status code indicating that Cloudflare successfully established a TCP connection with your origin web server, but the server failed to send an HTTP response within Cloudflare's default Proxy Read Timeout window of 125 seconds. It can also occur when Cloudflare successfully connects to write data to the origin, but the operation fails to complete before the unconfigurable 30-second Proxy Write Timeout (or 6.5 seconds for Cloudflare Images).

Unlike connection-refusal errors where the server cannot be reached, Error 524 confirms that your origin acknowledged the incoming request but required too much execution time to finish it. Resolving it requires diagnosing long-running backend processes, moving heavy tasks to asynchronous job queues, isolating long-running utility operations to non-proxied subdomains, or extending read timeouts if you use an Enterprise plan.
Understanding Timeout Boundaries in Cloudflare
When proxied through Cloudflare, connections maintain strict timeout limits between Cloudflare edge nodes and your origin server:
- Proxy Read Timeout (125 Seconds Default): Cloudflare establishes the TCP handshake and delivers the client's request. If the origin web server does not return HTTP response headers before 125 seconds elapse, Cloudflare terminates the wait and outputs Error 524.
- Proxy Write Timeout (30 Seconds Limit): Cloudflare connects to transmit data (such as an HTTP POST payload) to your origin, but the transmission cannot complete within 30 seconds (6.5 seconds for Cloudflare Images). This limit cannot be customized.
If your requests fail before any TCP handshake or ACK response can occur, review our troubleshooting guide for Cloudflare Error 522 (Connection Timed Out).
Origin-Side Causes and Diagnostic Steps
1. Collect Detailed Origin Telemetry
Because Error 524 stems from origin processing bottlenecks, Cloudflare recommends gathering detailed request information to share with your hosting provider or server administrator:
- The specific HTTP 524 error code and response text.
- The exact timestamp and timezone when the timeout occurred.
- The exact request URL that triggered the timeout (for example,
https://example.com/reports/export.php). - Server-side access and error logs showing the total execution time (such as
$request_timein Nginx or%Din Apache log formats). - Logs from any reverse proxies, firewalls, or load balancers sitting between Cloudflare and your application server.
If prolonged database queries lead to connection exhaustion across your site, refer to our troubleshooting walkthrough for WordPress Error Establishing a Database Connection.
2. Implement Asynchronous Status Polling
For operations that naturally exceed standard web timeout thresholds (such as report generation, heavy data exports, or batch file imports), official documentation recommends refactoring the workflow into asynchronous status polling:
- Configure the request endpoint to pass the task to a background job worker immediately.
- Return an immediate HTTP response (such as status code 202 Accepted) along with a unique task identifier.
- Direct the client application or browser to poll a separate lightweight status endpoint periodically until the background job finishes.
Cloudflare Configuration Workarounds
Option A: Offload Long Tasks to a DNS-Only Subdomain
Warning: Changing an A, AAAA, or CNAME record to DNS-only exposes your origin server's direct IP address, bypassing Cloudflare Web Application Firewall (WAF), caching, and DDoS mitigation for that specific hostname. Restrict access to administrative subdomains using strict origin firewall rules and valid SSL certificates.
If you regularly run maintenance tasks or data exports that take longer than 125 seconds, Cloudflare recommends moving those workflows behind an unproxied subdomain:
- Log in to the Cloudflare Dashboard and select your zone.
- Navigate to DNS > Records.
- Create an administrative record (such as
admin.example.com) pointing to your origin IP address. - Toggle the Proxy status from Proxied (orange cloud) to DNS-only (grey cloud).
- Run long administrative processes exclusively through the DNS-only hostname.
Option B: Adjust Proxy Read Timeout (Enterprise Zones Only)
Enterprise plan customers can increase the Proxy Read Timeout limit up to 6,000 seconds through Cache Rules or the Cloudflare API:
- Via Cache Rules: In the dashboard, go to Caching > Cache Rules. Create a rule matching the desired URL path and configure the Proxy Read Timeout setting. Note: The matching request path must be eligible for caching to trigger the rule, but the content does not actually need to be cached.
- Via Cloudflare API: Use the Edit Zone Setting endpoint to modify the
proxy_read_timeoutattribute for the zone.
Verification and Testing
After optimizing your origin processing or updating Cloudflare configurations, verify that requests complete within expected limits:
- Trigger the problematic operation and confirm it completes with an HTTP 200 or HTTP 202 response instead of Error 524.
- Inspect Analytics & Logs > Edge traffic or Zone Analytics in the Cloudflare Dashboard to verify that 5xx error rates decrease across matching routes.
- Examine your origin web server access logs to confirm that average response times remain well below the 125-second limit.