Cloudflare Error 524 can appear even when your origin server is running, your hosting dashboard reports no outage and other pages on your website continue loading normally. The error means Cloudflare successfully connected to the origin but the expected response did not arrive within the allowed time.
The problem may involve a slow database query, overloaded application workers, an external service that is not responding or a long-running operation such as report generation. To resolve it, identify the affected request, measure where the delay occurs, inspect the corresponding server activity and correct the component responsible.
Check Which Request Is Timing Out
Start by identifying exactly when Error 524 occurs. A server that loads ordinary pages successfully may still struggle with database-heavy dashboards, exports or API requests that require substantially more processing time.
Cloudflare's default Proxy Read Timeout is 125 seconds but this is not an unconditional limit on the total duration of every HTTP request. It measures the allowed interval between successive reads from the origin, so a request that continues delivering response data may last longer without necessarily triggering Error 524.
The error commonly appears when the origin accepts a request but does not send the expected response data within that interval. This distinction matters because a server performing a lengthy calculation without producing a response requires a different investigation from one that continues transmitting data successfully.
Before changing any settings, collect the following information about the affected request:
Affected URL: Identify the page, API endpoint or operation that produces Error 524.
Request type: Determine whether it is a normal page load, report generation, upload, export or API request.
Failure timing: Record approximately how many seconds pass before the error appears.
Other pages: Check whether unrelated pages continue loading normally.
Error details: Save the timestamp, timezone and Cloudflare Ray ID displayed with the error.
Avoid repeatedly submitting expensive reports, imports, payments or other operations that change data. Multiple attempts can increase server load or create duplicate actions while you are still investigating the original failure.
Use the failure pattern to narrow the cause
| What happens | Where to investigate |
|---|---|
| The request fails after approximately 125 seconds without an origin response | Origin response time and application processing |
| Only reports or exports fail | Database queries and long-running application tasks |
| Several pages fail during traffic spikes | CPU, memory and application worker availability |
| One API endpoint repeatedly times out | Application execution and external dependencies |
| Large uploads trigger Error 524 | Request transfer and origin receiving performance |
| The same request sometimes succeeds | Intermittent resource contention or dependency delays |
These observations help determine which checks are relevant. For example, a slow reporting endpoint should lead you toward database and application logs, while widespread failures during peak traffic require closer examination of shared server resources.
Once you have identified a specific failing request, measure its behaviour through Cloudflare before adjusting the configuration. This provides a baseline for determining whether the problem is consistent and whether subsequent changes improve response time.
Measure the Delay Before Changing Settings
For a page or endpoint that can safely receive a GET request, use cURL to measure the response time through Cloudflare. This test helps establish how long the request takes before returning a response or error.
Open a terminal and run the following command:
curl -sS -o /dev/null \
-w 'HTTP: %{http_code}\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n' \
--max-time 145 \
https://example.com/affected-pageReplace example.com/affected-page with the actual URL. Do not use this command as a substitute for authenticated POST requests, payment submissions or other operations that require a different method or could change application data.
The output provides the HTTP status, time to first byte (TTFB), and total request duration. If the request returns HTTP 524 after approximately 125 seconds, that is consistent with Cloudflare waiting for an origin response until its default read timeout is reached.
Remember that cURL measures the response received by the client. When Cloudflare generates the Error 524 response, the reported TTFB does not independently reveal when the origin attempted to respond.
If the request succeeds during another attempt, compare successful and unsuccessful requests under similar conditions. Intermittent delays may indicate changing server load, database contention or a dependency that occasionally takes too long.
Check the affected endpoint in Cloudflare Origin Analytics
If Origin Analytics is available in your Cloudflare account, open the dashboard, select the affected domain and navigate to Speed → Origin Analytics. Select the period when Error 524 occurred and examine the origin response-time measurements.
Pay attention to P95 and P99 values, which can reveal slow requests that might not be obvious from average response times. Compare these measurements with the periods when the affected operation failed.
Check the Top endpoints table for the affected path. If the endpoint consistently has high response times, use that information to guide the next server-side investigation.
Origin Analytics measures the upstream request path until Cloudflare receives response headers. This includes network and connection overhead, so its measurements should not be treated as identical to application execution time.
If Origin Analytics is unavailable, continue using the response measurements and server logs provided by your hosting environment. The important objective is to establish whether the affected operation is consistently slow before making changes.
Compare Cloudflare With a Direct Origin Request
The next check is whether the origin responds slowly when the request bypasses Cloudflare's normal proxy path. This comparison can help determine whether the delay is reproducible at the application server.
You can perform an authorized direct-origin test without changing public DNS records or disabling Cloudflare protection for ordinary visitors. From a terminal on a machine authorized to access the origin, run:
curl -sS -o /dev/null \
--resolve example.com:443:203.0.113.10 \
-w 'HTTP: %{http_code}\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n' \
--max-time 155 \
https://example.com/affected-pageReplace example.com with your hostname and 203.0.113.10 with your actual origin server IP address. The IP address shown in this example is reserved for documentation and is not a real server destination.
The --resolve option sends the request to the specified origin IP while preserving the hostname used for HTTPS. This allows you to compare the direct-origin response with the response received through Cloudflare.
If your origin uses a Cloudflare Origin CA certificate, an external cURL request may fail because the certificate is not publicly trusted. Similarly, a firewall that permits only Cloudflare traffic may block the direct test.
In either situation, do not interpret the connection or certificate failure as evidence that the application is slow. Use an authorized server-side request or your hosting provider's performance measurements instead.
Decide what to investigate from the result
| Test result | Next action |
|---|---|
| Both requests are slow | Continue to server and application logs |
| Direct origin is fast but Cloudflare returns 524 | Verify that both requests reach the same backend and execute the same operation |
| Direct origin cannot be accessed | Use authorized server-side timing and application logs |
| Direct origin is intermittently slow | Compare failures with resource usage, database activity and background jobs |
If both requests are slow, investigate the application's processing time. A delay reproduced at the origin is strong evidence that the problem exists independently of Cloudflare's normal proxy path.
If the origin is fast but Cloudflare still returns Error 524, verify the actual origin destination, request method, authentication context, headers and application route. Origin Rules, load balancers or other infrastructure may cause the proxied request to follow a different processing path.
If direct access is blocked, avoid changing production firewall rules merely to perform the comparison. Continue using origin request logs, existing monitoring tools or measurements provided by your hosting administrator.
The next objective is to identify what happened to the failing request after it reached the origin. Server and application logs can help establish whether the delay occurred before the application responded or while another component was processing the request.
Find the Delay in Server and Application Logs
Open the logs covering the time when Error 524 appeared and search for the affected request path. Compare its timestamp with the failure recorded in Cloudflare to identify the corresponding server activity.
Do not assume an empty error log means the request completed successfully. A web server may record an unusually long request in its access logs without producing a separate application error.
Examine Nginx request activity
On Linux servers using Nginx, access logs are commonly stored under /var/log/nginx/, although the actual location depends on your hosting configuration. If you have appropriate server access, inspect recent requests using:
sudo tail -n 100 /var/log/nginx/access.logTo narrow the investigation to one endpoint, search the access log for the relevant path. The following command displays recent matching entries without modifying the log:
sudo grep -F '/reports/export' \
/var/log/nginx/access.log | tail -n 20Replace /reports/export with the path associated with your Error 524 request. Compare the matching entries with the timestamp and request details recorded earlier.
Standard Nginx access logs may not include enough timing information to identify the bottleneck. If request-timing fields are already configured, examine the following measurements.
| Nginx variable | What it measures |
|---|---|
$request_time | Total request-processing duration |
$upstream_connect_time | Time required to establish the upstream connection |
$upstream_header_time | Time until upstream response headers begin arriving |
$upstream_response_time | Time required to receive the upstream response |
An unusually high $upstream_header_time suggests that Nginx spent substantial time waiting for the upstream application to begin responding. Compare that measurement with application or database activity before deciding what caused the wait.
The Nginx error log may provide additional evidence about upstream connections or failed requests. Inspect recent entries using:
sudo tail -n 100 /var/log/nginx/error.logLook for upstream timeout messages, connection closures or other errors around the failure time. If the logs do not expose request duration, ask your hosting administrator whether request timing can be enabled safely or retrieved from existing monitoring tools.
Check PHP-FPM for slow or queued requests
If your website uses PHP-FPM, examine its logs and any available slow-request traces. PHP-FPM supports request_slowlog_timeout, which can record a backtrace when a request exceeds a configured duration.
Use the slow trace to identify whether PHP is waiting inside a database operation, calling an external API, or executing an expensive function. Check the PHP-FPM status information where available to see whether requests are waiting for workers.
Pay particular attention to the listen queue, active processes, and whether max children reached has increased. A growing queue can indicate that the available workers are occupied, while slow-request traces may explain what those workers are doing.
Do not increase PHP-FPM worker limits immediately. First determine whether the delay comes from insufficient capacity or from requests that occupy workers for an unusually long time.
On managed hosting, PHP-FPM settings and logs may not be directly accessible. In that case, ask the hosting provider for slow-request information and worker-capacity measurements covering the affected period.
Follow the request into the application
If the web server confirms that the request reached the application, inspect the application's logs for the same period. Look for database waits, external-service calls, long-running tasks or processing errors associated with the affected endpoint.
For a database-driven application, check available slow-query logs or query-performance reports. If the delay comes from an external service, compare its response time with the total application request duration.
At this stage, the evidence should point toward a more specific problem, such as database processing, worker saturation or an external dependency. Use that finding to select the appropriate correction instead of modifying unrelated server or Cloudflare settings.
Correct the Operation Responsible for the Timeout
Apply one relevant correction at a time and measure the affected request again. Changing multiple timeouts, server limits and application settings simultaneously can hide the actual cause and make later failures harder to diagnose.
A database query is taking too long
If the application logs identify a slow database query, inspect its execution plan and determine why it requires so much processing time. Look for inefficient joins, missing indexes, lock waits or unexpectedly large result sets.
For example, a reporting query may perform well when a table is small but become much slower as the database grows. An appropriate index, query adjustment or reduction in the amount of data processed can improve its response time.
Make changes using the database's normal review and deployment procedures. After applying the correction, run the same safe operation and compare its execution time with the original measurement.
If the query remains slow, check for locking or resource contention before creating additional indexes. Adding indexes without examining query behaviour can increase maintenance costs without addressing the actual bottleneck.
PHP workers or server resources are overloaded
If multiple requests become slow during the same period, compare the failures with CPU usage, available memory and application worker activity. On a Linux server with appropriate access, you can begin by running:
uptime
free -h
topThese commands provide an initial view of system load, memory availability and active processes. Compare the results with the time of the failing requests rather than assuming high usage at an unrelated moment explains Error 524.
If PHP-FPM is reaching its worker limit, examine the requests occupying those workers. A slow database query or external API call may keep workers busy and cause new requests to wait.
Reduce the expensive workload before increasing worker capacity. Adding more workers without sufficient memory can worsen resource pressure rather than resolve the timeout.
If capacity remains insufficient after addressing slow operations, review the appropriate worker settings or hosting resources with your administrator. Verify the effect using request times and queue measurements instead of relying only on the server's reported resource usage.
An external API is delaying the application
If an application request waits on another service, inspect the outbound request timing and determine how much of the delay comes from that dependency.
For example, a dashboard may wait for a remote API before returning its response. If that service is unusually slow, the application can exceed Cloudflare's read timeout even though its own server has sufficient CPU and memory.
Review the external call's timeout and retry behaviour. Where appropriate, handle failures promptly or move work that does not require an immediate response into a background task.
After changing the application, test its behaviour when the external service is slow or unavailable. The correction should produce a controlled application response rather than simply hiding the original timeout.
Report generation or exports take several minutes
Some operations exceed Cloudflare's timeout because the task itself requires substantial processing time without sending an interim response. Large exports, complex reports and bulk operations may remain slow even after reasonable performance improvements.
If the application supports background processing, avoid keeping the original browser request open until the entire task finishes. Instead, separate the lengthy operation from the HTTP request that initiated it using a workflow such as:
Accept the export request and create a background processing job.
Return a job identifier promptly instead of keeping the original connection open.
Process the export independently of the browser request.
Allow the application to check the job's progress.
Make the completed file available after processing finishes.
This separates long-running work from the initial HTTP response. Before modifying the application, check whether its existing reporting or export features already support asynchronous processing.
Error 524 Still Appears After the Correction?
If the same operation continues failing, compare the latest results with your original measurements. Determine whether the previous correction reduced the delay, changed the failure pattern or had no measurable effect.
Use the remaining evidence to select the next investigation rather than repeating every previous test. The appropriate next action depends on what is still failing.
| Remaining problem | Next action |
|---|---|
| The origin still responds too slowly | Recheck the application trace, database waits and worker queues |
| Direct origin is fast but Cloudflare times out | Verify backend selection, request differences and origin routing |
| Error occurs only during uploads | Investigate request transfer and origin receiving performance |
| Failures happen during peak traffic | Examine worker saturation and resource contention |
| The operation produces no response data for longer than the allowed read interval | Use background processing or an eligible timeout configuration |
| Logs do not reveal the delay | Escalate with request-specific timing and error evidence |
Check the upload timeout separately
Cloudflare can also return Error 524 when it successfully connects to the origin but cannot finish writing request data within the 30-second Proxy Write Timeout. This is different from the 125-second Proxy Read Timeout, which governs the interval between successive origin reads.
If the failure occurs during an upload, inspect whether the origin is receiving data slowly or whether reverse-proxy buffering, application behaviour or resource pressure is delaying the transfer. Compare the request's behaviour with the origin logs before deciding which component is responsible.
Do not assume that increasing PHP execution time will resolve an upload-related write timeout. Cloudflare's Proxy Write Timeout is not adjustable through the usual timeout settings, so the investigation must concentrate on why the request data is not being transferred within the allowed interval.
Review timeout configuration only when necessary
Cloudflare Enterprise customers can configure a longer Proxy Read Timeout, up to 6,000 seconds, through supported zone settings. Eligible Cache Rules can also apply a custom read timeout to qualifying requests.
These options are relevant when an application legitimately requires a longer interval between origin reads and its processing cannot reasonably be shortened. They are not a substitute for correcting unexpectedly slow database operations, overloaded workers or failing dependencies.
Cloudflare also documents using a dedicated DNS-only hostname for requests that regularly exceed the standard proxy timeout. However, that hostname no longer receives Cloudflare's normal reverse-proxy protection, so its origin security and authentication must be evaluated before using this approach.
Avoid disabling Cloudflare proxying for your main production website simply to bypass Error 524. Prefer correcting the slow operation or moving lengthy work into background processing when the application supports it.
Escalate with evidence from the failing request
If the origin appears healthy during controlled tests but Cloudflare continues returning Error 524, collect the information needed for your hosting provider or Cloudflare support to investigate. Include the affected URL, request method, failure timestamp, timezone, Ray ID and approximate duration before the error appeared.
Provide sanitized results from the proxied and direct-origin tests, along with relevant application or server-log entries. Explain which investigations have already been completed and whether the problem affects one endpoint or several.
This makes it easier for the hosting provider or Cloudflare support to examine the unresolved request path. It also reduces the likelihood of repeating basic checks that have already produced useful results.
Confirm That the Request Now Completes
After correcting the responsible operation, repeat the original safe request through Cloudflare. Compare its HTTP status, response time and application behaviour with the measurements recorded before troubleshooting.
The request should complete successfully without Error 524, and the origin should provide response data within the applicable timeout intervals. If the original problem occurred intermittently, monitor the endpoint during comparable traffic conditions rather than relying on one successful attempt.
For reports, exports or other long-running operations, verify that the application produces the complete expected result. A faster response does not establish that the problem is resolved if the operation now skips important processing or returns incomplete output.
Continue monitoring the affected endpoint for recurring delays. Origin response-time measurements, application logs and worker-capacity information can help detect the same bottleneck before it produces another timeout.
The essential distinction is that Cloudflare Error 524 occurs after the origin connection succeeds but the expected response or request transfer does not progress within the applicable timeout. The troubleshooting therefore needs to follow the request into the application rather than treating a running server as proof that everything is working correctly.
If Cloudflare cannot establish the expected connection or receive the required request acknowledgment instead, that is a different failure. BusinessTally's existing guide, Cloudflare Error 522 on a Running Server: Find the Cause, covers that separate connection-timeout problem.
For Error 524, the correction is complete when you have located the delay, addressed the responsible operation and confirmed that the affected request now finishes reliably. The final verification should reproduce the original operation successfully, not merely demonstrate that the homepage or a separate test page responds.


