Cloudflare Error 524 (A Timeout Occurred): Causes and a Tested Fix

Cloudflare error 524 page, A timeout occurred, which I reproduced with a slow PHP script that timed out at 125 seconds.

Error 524 (A timeout occurred) means Cloudflare connected to your origin server (the real server behind Cloudflare) and sent the request, but the server did not send back an answer in time. Cloudflare waits 125 seconds by default (only Enterprise plans can raise it), then gives up and shows error code 524 instead of the page. Cloudflare and the visitor’s connection are working; something on the server is taking too long.

If you only see error code 524 on someone else’s site, a game or an app, the problem is on their servers, not your device. If it is your site, below I show how I caused error 524 on a test server, the exact second Cloudflare gave up, why one attempt returned 502 instead, and the steps that find and fix the slow request.

Tested by Dolon Bepari, 20 November 2026

  • Server: a throwaway Ubuntu 22.04 VPS (1 vCPU, about 2 GB RAM), aaPanel 7, Nginx 1.30.7, PHP 8.4 (PHP-FPM), WordPress
  • Cloudflare: Free plan, orange cloud (proxied), test domain filecafe.site; test page: a PHP script that took about 150 seconds to answer
  • How I measured: curl and a browser from my PC in Dhaka, Bangladesh, through Cloudflare, plus curl on the server itself
  • There are no affiliate links in this guide. How I test: how we review

What error code 524 means

Error 524 is a Cloudflare status code, not a standard HTTP one. Cloudflare’s error 524 page (last updated 23 July 2026, checked 21 November 2026) says the Proxy Read Timeout is 125 seconds by default. That is how long Cloudflare waits for your server’s response after it sends the request. Enterprise plans can raise it to 6,000 seconds. The browser page calls it A timeout occurred, so “a timeout occurred error code 524” and “error code 524 cloudflare” are the same problem.

Cloudflare Error 524 A timeout occurred page in the browser, with the host marked as the error.
The 524 page from my lab: Browser working, Cloudflare working, Host error. 20 November 2026, 17:02:07 UTC.

The red Host box points at your server, but the server is not down. With error 521 the server refuses the connection, and with error 522 the connection never opens. With 524 the connection worked and the request arrived; the answer did not come back within 125 seconds.

Is error code 524 bad? Visitor vs site owner

If you are a visitor, it is not your fault and not dangerous. Nothing is wrong with your device or connection, and clearing your cache will not help. Often the request was simply too heavy or the server was busy. Wait a minute and try again, check the service’s status page, and if it keeps happening on a website, tell the owner and include the Ray ID, the short reference code Cloudflare prints at the bottom of its error pages.

If a game or an app shows error code 524 and the error comes from Cloudflare, that service’s servers did not answer in time. I have not tested any game, and an app can use its own error numbers, so check that service’s status page or support site.

If you own the site, it is bad when it repeats. Every 524 is a visitor who waited more than two minutes and got an error. The fix is on your server: find the request that takes too long and make it faster, shorter or move it out of the visitor’s request. Upgrading your Cloudflare plan does not change the 125-second limit unless you move to Enterprise.

How I reproduced error 524 (and what I measured)

None of the top-ranking guides I read caused a 524 and timed it. I did, on a throwaway VPS that I deleted afterwards, running WordPress on a test domain proxied through Cloudflare’s Free plan. The test page was a small PHP script that deliberately takes about 150 seconds before it answers, longer than Cloudflare’s limit.

Throwaway Ubuntu 22.04 test VPS used for the Cloudflare error lab, with 1 vCPU, about 2 GB RAM and a 25 GB disk.
The test server: Ubuntu 22.04, 1 vCPU, about 2 GB RAM, 25 GB disk (server name blurred).

First try: 502 Bad Gateway after 100 seconds, not 524

My first request through Cloudflare did not return 524 at all. After 100.589391 seconds it came back as HTTP/1.1 502 Bad Gateway. The time matched PHP-FPM’s request_terminate_timeout, which was 100 seconds on this server. PHP-FPM is the service that runs PHP for Nginx, and this setting is how long it lets one PHP request run before it stops it. When I raised that limit, the same request ran on until Cloudflare’s 524 (below), which points to my own server ending the request before Cloudflare’s 125 seconds were up.

curl from Windows cmd through Cloudflare returning HTTP/1.1 502 Bad Gateway after 100.589391 seconds, not 524.
PHP-FPM limit 100 seconds: 502 Bad Gateway after 100.589391 seconds, before Cloudflare’s 125-second limit.

Raising the PHP-FPM limit to 300 seconds

To let the request reach Cloudflare’s limit, I set request_terminate_timeout to 300 in PHP 8.4’s php-fpm.conf and reloaded PHP-FPM. On aaPanel that file is /www/server/php/84/etc/php-fpm.conf. This was only for the test: a higher limit lets one stuck PHP request hold a PHP worker for up to five minutes.

PHP-FPM request_terminate_timeout set to 300 in php-fpm.conf on the test server, followed by a PHP-FPM reload.
request_terminate_timeout = 300 on line 21, then PHP-FPM reloaded (server name blurred).

524 at 125.29 seconds, twice

With PHP-FPM out of the way, the same request through Cloudflare returned 524 after 125.291390 seconds. A second run, later in the session, returned 524 after 125.291768 seconds. Both requests timed out at 125 seconds, less than a millisecond apart. That matches Cloudflare’s documented 125 seconds. Its docs say a 524 can arrive up to about one second after the configured timeout; mine came 0.29 seconds after, and curl’s total time also includes connecting from my PC.

curl to the slow test script returning Cloudflare 524 after about 125 seconds.
First run: 524 after 125.291390 seconds.
A repeat run of the slow script test returning 524 again at about 125 seconds.
Second run: 524 after 125.291768 seconds.

The origin finished the page in 150 seconds

Then I called the same script on the server itself, skipping Cloudflare. It returned 200 after 150.010914 seconds. So the page worked; it was just slower than Cloudflare is willing to wait. That is the typical 524: nothing is broken, one request takes too long. I did not check whether the script kept running on the server after Cloudflare showed the 524, so I will not claim either way.

Called directly on the origin, the same slow script finishes with 200 after about 150 seconds.
Directly on the origin: 200 after 150.010914 seconds (server name blurred).

A trap in my test: aaPanel’s page cache hid the slow page

After the first 524, the slow page suddenly answered with 200 in about 0.2 seconds, which made no sense. The WordPress site that aaPanel’s WP Toolkit created had Nginx FastCGI page caching on by default: the site’s Nginx config included enable-php-84-wpfastcgi.conf. Nginx served a cached copy and never ran the slow script. I did not measure why the cache only answered from that point on.

I switched the include to plain enable-php-84.conf and threw away the 0.2-second results. The 150-second origin timing and the second 524 above were both measured after this change.

Nginx vhost on the aaPanel test server switched from include enable-php-84-wpfastcgi.conf to include enable-php-84.conf, with the config test passing.
The site’s Nginx config backed up, the include changed to enable-php-84.conf, and nginx -t passing (server name blurred).

This matters when you troubleshoot your own 524: if a page cache answers your test, you are timing the cache, not the slow request. Step 3 below shows how to check this on aaPanel.

How long is the Cloudflare 524 timeout? 125 seconds, not 100

Several of the top-ranking guides I read still say Cloudflare waits 100 seconds. That figure is out of date: Cloudflare’s docs now say 125 seconds, and my two requests ended at 125.29 seconds. Here is what each limit means for you.

LimitValue (Cloudflare docs, checked 21 Nov 2026)What it meansMy test
Proxy Read Timeout125 seconds (Free, Pro, Business)How long Cloudflare waits for your server’s response524 at 125.291390 and 125.291768 s
Proxy Read Timeout, EnterpriseUp to 6,000 secondsEnterprise can raise it with a Cache Rule or the zone setting proxy_read_timeoutNot tested
Proxy Write Timeout30 seconds, cannot be changedHow long Cloudflare waits while sending a request to your server, such as a large uploadNot tested
Delay after the timeoutAbout 1 secondA 524 can arrive about one second after the configured value125.29 s (within that second)

What causes error 524

Cloudflare’s 524 documentation lists three causes. I reproduced the first one with a deliberately slow script; the rest are Cloudflare’s descriptions, not my tests.

  1. The server has too much work or is short on resources. A large database query, a big export or import, or a report that takes minutes. This was my lab: a page that needed about 150 seconds. When CPU, memory or PHP workers run out, a normally quick page can also pass 125 seconds (not tested).
  2. The server accepts the connection but answers too slowly. Not tested separately. For example, PHP waits on a slow external API or a locked database table.
  3. Cloudflare cannot finish sending the request. If writing the request to your server takes longer than the 30-second Proxy Write Timeout, for example a large upload to a slow server. Not tested.

On WordPress, common places to look are imports and exports, backup plugins, page builders saving large pages, WooCommerce reports and wp-cron tasks. These are examples to check, not things I tested. Also note what did not cause a 524 in my lab: when PHP-FPM’s own limit was shorter than 125 seconds, the visitor got a 502 instead.

How to fix error 524, step by step

Every command below says where to run it and what it does. Only the ones marked “changes” modify anything. Replace example.com with your domain and /slow-page/ with the address that shows the 524. Where aaPanel differs from a standard Nginx install, I say so.

Step 1: Confirm the 524 and time it

▶ On your own computer, in Windows cmd (not PowerShell). On Mac or Linux, use curl instead of curl.exe and /dev/null instead of NUL:

curl.exe -sS -o NUL -w "%{http_code} %{time_total}\n" https://example.com/slow-page/

What it does: requests the page through Cloudflare once and prints the status code and the total time (-S makes curl still show an error if one happens). It changes nothing, but it can take over two minutes, so wait for it. A 524 near 125 seconds confirms this guide’s problem; mine were 125.29 seconds. A 502 or 504 well before 125 seconds points to your server’s own timeouts (step 6). A 522, 521 or 520 is a different error (see the table below).

Step 2: Time the same page on the origin, without Cloudflare

▶ On the server (SSH terminal):

curl -sSk -o /dev/null -w "%{http_code} %{time_total}\n" --resolve example.com:443:127.0.0.1 https://example.com/slow-page/

What it does: requests the page from the web server on this machine, skipping DNS and Cloudflare, and prints the status and time. It changes nothing. -k skips the certificate check, which a local test needs if the server uses a Cloudflare Origin CA or self-signed certificate. In my lab this returned 200 after 150.01 seconds. If your origin also takes more than 125 seconds, the slowness is on your server and the next steps apply. Pages that need a login, such as an import in wp-admin, redirect curl to the login page; time those in the browser instead.

Step 3: Make sure a page cache is not hiding the slow request

If step 2 answers in well under a second, a page cache may be answering instead of PHP, as in my lab. On aaPanel, check the site’s Nginx config:

▶ On the server (SSH terminal), as root or with sudo:

grep -n "enable-php" /www/server/panel/vhost/nginx/example.com.conf

What it does: shows which PHP include the site uses. It changes nothing. A line with wpfastcgi means Nginx FastCGI page caching is on. For a test, you can switch it to plain PHP:

▶ On the server (SSH terminal), aaPanel only, as root or with sudo (changes the site’s Nginx config and reloads Nginx; replace 84 with your PHP version):

ls /www/server/nginx/conf/enable-php-84.conf && cp /www/server/panel/vhost/nginx/example.com.conf /root/example.com.conf.bak && sed -i 's/include enable-php-84-wpfastcgi.conf;/include enable-php-84.conf;/' /www/server/panel/vhost/nginx/example.com.conf && /www/server/nginx/sbin/nginx -t && /www/server/nginx/sbin/nginx -s reload

What it does: first checks that the plain PHP include exists, then saves a backup copy of the config, switches the include, tests the configuration and reloads Nginx only if the test passes. This is the same change I made in my lab. If nginx -t reports an error, restore the backup with the next command before doing anything else. Turning page caching off makes normal pages slower for visitors, so restore it when you finish testing:

▶ On the server (SSH terminal), aaPanel only, as root or with sudo (changes the site’s Nginx config back and reloads Nginx):

cp /root/example.com.conf.bak /www/server/panel/vhost/nginx/example.com.conf && /www/server/nginx/sbin/nginx -t && /www/server/nginx/sbin/nginx -s reload

What it does: puts the original config back (page cache on again), tests it and reloads Nginx.

Step 4: Find what is slow

▶ On the server (SSH terminal), as root or with sudo; aaPanel log path (on a standard Nginx install, use /var/log/nginx/error.log):

tail -n 50 /www/wwwlogs/example.com.error.log

What it does: shows the last 50 lines of the site’s Nginx error log. It changes nothing. Look for timeouts, PHP errors or the same URL repeating at the time of the 524. Cloudflare also recommends logging response times on your server to see which URLs take longest (not tested here). Then check whether the server is overloaded:

▶ On the server (SSH terminal):

top -b -n 1 | head -n 15

What it does: prints one snapshot of CPU and memory use and the busiest processes. It changes nothing. Many PHP-FPM or database processes near the top while the 524 happens point to overload rather than one heavy task (both are cause 1 above).

Step 5: Make the request shorter, or move the work out of it

This is the real fix, and Cloudflare’s own advice. Make the slow task finish well under 125 seconds: add a database index, process a big import in smaller batches, or export fewer rows at a time. I did not test these on WordPress; they are the standard ways to shorten a request.

If the job really needs minutes, run it in the background. With status polling, the request only starts the job and answers at once with a job ID; the page then asks a small status URL every few seconds until the job is done. Each request is short, so Cloudflare never times out. For one-off WordPress work such as large imports, running the task over SSH with WP-CLI skips Cloudflare entirely. I did not test either.

Step 6: Check your server’s timeouts so they don’t hit first

This does not fix a 524, but it explains strange results. In my lab, PHP-FPM’s 100-second limit turned the problem into a 502 at 100.59 seconds. Read your current value:

▶ On the server (SSH terminal), aaPanel path for PHP 8.4 (on a standard install, try grep -rn request_terminate_timeout /etc/php/):

grep -n "request_terminate_timeout" /www/server/php/84/etc/php-fpm.conf

What it does: prints the line that sets the PHP-FPM time limit (a line starting with ; is switched off). It changes nothing. Nginx’s fastcgi_read_timeout can end a slow request too. If either limit is under 125 seconds, a request that needs between that limit and 125 seconds fails with a 502 or 504, even though Cloudflare would have waited. I did not test a request in that range.

To raise the PHP-FPM limit the way I did for the test:

▶ On the server (SSH terminal), aaPanel only, as root or with sudo (changes PHP-FPM’s settings and reloads it; replace 84 with your PHP version):

sed -i 's/^request_terminate_timeout = .*/request_terminate_timeout = 300/' /www/server/php/84/etc/php-fpm.conf && grep -n "request_terminate_timeout" /www/server/php/84/etc/php-fpm.conf && /etc/init.d/php-fpm-84 reload

What it does: sets the limit to 300 seconds, prints the line to confirm and reloads PHP-FPM. In my lab this turned the 502 into a 524 at 125 seconds, so it cannot get a request past Cloudflare’s limit. Raise it only if requests legitimately need between your current limit and 125 seconds.

Step 7: For requests that must take longer than 125 seconds

Cloudflare suggests putting such requests on a subdomain whose DNS record is set to DNS only (grey cloud), so Cloudflare does not proxy them. The catch: that subdomain shows your server’s real IP address and gets none of Cloudflare’s protection or caching. Enterprise customers can instead raise the Proxy Read Timeout with a Cache Rule or the zone setting. I did not test either.

Step 8: Check that it is fixed

Run the command from step 1 again. You should get 200 (or a normal redirect) well under 125 seconds. If you changed a page cache for testing in step 3, restore it, purge it and run the test once more.

On shared hosting

On shared hosting you usually cannot change PHP-FPM or Nginx. Find the slow plugin or task with your host’s logs, and send your host the Ray ID, the time and the URL of the 524. If your host cannot help, a small VPS gives you full control; I tested Vultr, Hetzner and DigitalOcean with real numbers.

Error 524 vs 522, 521, 520 and 502

All of these came from the same test server, through the same Cloudflare zone. The time it takes to fail tells you a lot.

ErrorWhat happenedTime to fail in my testsGuide
524 A timeout occurredConnected, request sent, no answer within 125 seconds125.29 sThis page
502 Bad GatewayEnded at PHP-FPM’s 100-second limit (the time matched it; raising the limit gave a 524)100.59 sStep 6 above
522 Connection timed outCloudflare’s connection to the server never opened (packets dropped)19.39 to 19.75 sError 522
521 Web server is downThe server refused the connection0.20 to 0.26 sError 521
520 Unknown errorThe server closed the connection without an answer0.20 to 0.27 sError 520

A certificate problem in Full (strict), the SSL mode that checks your server’s certificate, gives error 526 instead. If the SSL handshake itself fails, Cloudflare shows error 525; see my 525 test. A 504 Gateway Timeout is a standard HTTP code, not a Cloudflare-specific one: it usually comes from your own server or another proxy in front of PHP. I did not produce a 504 in my lab.

Does error 524 hurt SEO?

A rare 524 on one heavy page is unlikely to matter. Google’s documentation says 5xx server errors make Googlebot slow down crawling, and that indexed URLs that keep returning server errors are eventually dropped from the index. A 524 is usually limited to slow pages, but if normal pages time out because the server is overloaded, fix it quickly.

How to prevent error 524

  • Keep heavy jobs out of web requests. Imports, exports, backups and reports belong in background jobs, WP-CLI or a real cron job, not in a browser request.
  • Watch slow requests before they hit 125 seconds. A request that is slow today can pass 125 seconds as the database grows.
  • Know your server’s own limits. Check PHP-FPM’s request_terminate_timeout and Nginx’s fastcgi_read_timeout, so you know which one ends a slow request first.
  • Test with the cache out of the way. As my lab showed, a page cache can hide a slow page completely.
  • Keep the rest of the setup right. My Cloudflare settings for WordPress guide covers the settings I use.

Error 524 FAQ

How to fix 524 error?

Time the page through Cloudflare and directly on your server. If the server takes more than 125 seconds, make the request shorter (smaller batches, faster queries), move long jobs into the background with status polling, or put requests that must run longer on a DNS-only subdomain. Enterprise plans can raise the timeout. In my test, the origin needed 150 seconds and Cloudflare gave up at 125.29 seconds.

What does error 524 mean?

Cloudflare connected to the website’s server and sent the request, but the server did not answer within Cloudflare’s Proxy Read Timeout, 125 seconds by default. Cloudflare’s browser page calls it A timeout occurred.

Is error code 524 bad?

For a visitor it is harmless: nothing is wrong with your device, and you can try again later. For a site owner, repeated 524s mean visitors wait over two minutes and get an error, and Google slows crawling when a site keeps returning 5xx errors.

How do I fix my Cloudflare error?

Read the code first, because each one has a different cause. 524 is a slow server response, 522 a connection that never opened, 521 a refused connection, 520 an empty or invalid answer and 526 an invalid certificate. Each has its own guide on this site.

What does error code 524 mean in Roblox or a game?

If the 524 comes from Cloudflare, the game’s or app’s servers did not answer in time; it is not your device or account. I have not tested any game, and an app can use its own error numbers. Check the service’s status page and try again later.

How long does Cloudflare wait before error 524?

125 seconds by default, according to Cloudflare’s docs (last updated 23 July 2026). My two test requests ended at 125.291390 and 125.291768 seconds. Older guides that say 100 seconds are out of date.

Can I increase the Cloudflare 524 timeout?

Only on Enterprise, up to 6,000 seconds, with a Cache Rule or the proxy_read_timeout zone setting. On Free, Pro and Business the limit is 125 seconds, so make the request faster or move it to a DNS-only subdomain.

Why do I get 502 instead of 524?

Usually your server ended the request before Cloudflare’s 125 seconds. In my test PHP-FPM’s request_terminate_timeout of 100 seconds returned 502 Bad Gateway after 100.59 seconds; after raising it to 300, the same request returned 524 at 125.29 seconds.

Is error 524 the same as 504?

No. 524 is Cloudflare’s own code for its 125-second wait running out. A 504 Gateway Timeout is a standard HTTP code that usually comes from your own server or another proxy. I did not produce a 504 in my test.

Related Guides