Skip to content

Cloudflare Errors 521, 522 and 525: What They Mean and How to Fix Them

On this page

Last updated: · By

Short answer: Cloudflare errors 521, 522 and 525 mean Cloudflare could not talk to your server. Error 522 is a connection timeout, 521 is a server that refuses the connection, and 525 is a failed SSL handshake between Cloudflare and your server. On Cloudways the usual causes are a stopped or overloaded server, an A record pointing to an old IP address, and blocked Cloudflare IPs. For error 525 it is a missing or expired SSL certificate on the server.

⏱ Diagnosis time: 10–30 minutes · Difficulty: medium · Last checked: 7 Nov 2026

CodeWhat happenedCommon cause on CloudwaysFirst check
521The server refused the connection from CloudflareStopped server, web service down, Cloudflare IPs blockedIs the server running in the platform?
522Cloudflare waited for the server and got no responseA record pointing to an old IP, overloaded server, firewallIs the IP in Cloudflare the same as the server IP?
525The SSL handshake between Cloudflare and the server failedNo valid certificate on the server, in Full or Full (strict) modeThe SSL mode in Cloudflare and the certificate’s validity on the server

The definitions in the table follow the official Cloudflare documentation for errors 521, 522 and 525, as read on 7 Nov 2026.

Why does Cloudflare show an error if my site “works”?

When your domain goes through Cloudflare (the orange cloud), there are two connections: from the visitor to Cloudflare, and from Cloudflare to your server, also called the origin server. The 52x errors come from the second connection. The visitor reaches Cloudflare without trouble, but Cloudflare cannot get the page from your server.

This is different from ordinary 502 and 504 errors, where the server did answer, but with an error or too slowly. If that is your case, see 502 and 504 errors: what to check.

The first check is always: does the server respond without Cloudflare? On Cloudways you can open the application’s temporary URL, or bypass Cloudflare with a hosts file entry, as Cloudways recommends for testing. If the site loads there, the problem is in the connection between Cloudflare and the server, not in the site itself.

What is error 522 and how do I fix it?

Error 522 (Connection timed out) means Cloudflare contacted the server and did not get an answer in time. According to Cloudflare, there are two timeouts: 19 seconds to open a TCP connection, and 90 seconds for the server to acknowledge the request after the connection is open.

Cloudflare says the most common cause is that its IP addresses are blocked or rate-limited by the server’s firewall. In my check on 7 Nov 2026, the official IP list contained 15 IPv4 ranges and 7 IPv6 ranges. Any one of them can be the one that reaches your server.

  1. Compare IP addresses. In the platform, open Servers and copy the server’s Public IP. In Cloudflare, under DNS, check that the domain’s A record points exactly to it.
  2. Check the load. CPU or memory at 100% makes the server drop new connections. Look at the server’s monitoring graphs and, if needed, see slow website and high CPU.
  3. Check for blocks. If you blocked countries, IP ranges or request rates on the server, make sure the rules do not catch Cloudflare addresses. Cloudflare recommends filtering countries in its own WAF rules, not in the server firewall.

The classic case after a server move: according to the Cloudways server cloning guide, a cloned server gets a different IP address, and you need to update the DNS records. If you cloned a server or moved a site to another server within Cloudways, and then deleted or stopped the old one, you will get a 522 until the A record in Cloudflare is updated.

What is Cloudflare error 521?

Error 521 (Web server is down) means the server rejected the connection from Cloudflare. Cloudflare names two main causes: the web application on the server is not running, or Cloudflare’s requests are being blocked.

  1. In the platform, make sure the server is not in a Stopped state. A stopped server accepts no connections at all.
  2. On the server, open Server Management > Manage Services and check that Nginx, Apache and PHP-FPM are running. If a service has crashed, restart it from the same screen.
  3. Check that you have not blocked Cloudflare addresses, as with error 522.
  4. If the SSL mode in Cloudflare is Full or Full (strict), Cloudflare connects on port 443. Make sure the application has a certificate.

Does the error come and go, mostly at busy hours? That is usually a service crashing because of memory. Upsizing the server or tracking down a heavy plugin is better than restarting again and again.

How do I fix error 525 (SSL handshake failed)?

Error 525 happens when the SSL mode in Cloudflare is Full or Full (strict) and the SSL handshake with the server fails. If the error shows up in the browser itself and not on a Cloudflare page, see ERR_SSL_PROTOCOL_ERROR. According to Cloudflare, the common cause is that the server has no valid certificate. On Cloudways this mostly happens when a Let’s Encrypt certificate was not renewed, or when a new application went live without a certificate.

Note that according to the Cloudflare documentation on SSL modes, the automatic mode will not downgrade the setting from Full (strict) to Full when the server’s certificate expires. The certificate on the server is your responsibility.

  1. In the platform, open the application > SSL Certificate and check whether a certificate is installed and when it expires.
  2. Option A: Let’s Encrypt. Install or renew the certificate. According to Cloudways, when the domain is behind Cloudflare you may need to turn off the proxy temporarily until the certificate is issued. That exposes the server’s address for a short time.
  3. Option B: Cloudflare Origin Certificate. Create a certificate in Cloudflare and install it as a Custom SSL on Cloudways. According to the Cloudways guide, it is free and can be set to be valid for up to 15 years. The downside: browsers do not trust it directly, so it only suits a domain that always goes through Cloudflare.
  4. Purge the Cloudflare cache and check again.

Other SSL errors, such as a missing certificate chain or a Let’s Encrypt certificate that will not renew, are covered in the Cloudways SSL errors guide. According to the same guide, Cloudflare Enterprise users on Cloudways do not need an Origin Certificate.

Black Friday80% off
80% off 2 months of managed hosting

The code BFCM802 takes 80% off your bill for the first two months (up to $200 off per month), including unlimited free site migrations. New customers only, and only until the offer ends.

The offer ends on December 4, 2026 at 23:59 (UTC+2).

Ends in—days—hours—minutes—seconds
Code:
Grab the 80% now

Start with a free trial, no credit card. Enter the code at checkout and check that it shows up.

After Black Friday: 30% off for 3 months with the code ASAEL. On a large server (above about $444 a month) ASAEL already saves more today. BFCM802 vs. ASAEL calculator

How do I prevent these errors in the first place?

  • Keep a certificate on the server even behind Cloudflare. Leave a valid certificate on every application and use Full (strict) mode. Cloudflare recommends Full or Full (strict) to prevent malicious connections to your server.
  • A checklist for server moves. After every clone or move: update the A record, test the site, and only then stop the old server.
  • Careful blocking rules. Block countries and limit request rates in Cloudflare, not on the server. Protections worth enabling on the server itself: hardening security on Cloudways.
  • External uptime monitoring that alerts you to 52x errors before your customers call.

To connect a domain to Cloudflare from the start, including the right SSL mode: connecting a Cloudflare domain to Cloudways.

Frequently asked questions

What is the difference between error 521 and error 522?

With 521 the server refused the connection from Cloudflare, usually because the web service is down or Cloudflare IPs are blocked. With 522 the server did not answer in time: 19 seconds to open a connection or 90 seconds for a response. For 522, check the IP in the A record and the server load first.

Is the problem on my side or Cloudflare’s?

Almost always on your side, in the server or its settings. Test the site without Cloudflare, through the application’s temporary URL or a hosts file. If it loads there, the problem is in the connection between Cloudflare and the server: IP, firewall or SSL.

What causes error 525?

A failed SSL handshake between Cloudflare and the server when the SSL mode is Full or Full (strict). The common cause is that the server has no valid certificate, for example a Let’s Encrypt certificate that was not renewed. Reinstall a certificate or use a Cloudflare Origin Certificate.

Can I fix 525 by switching to Flexible mode?

That will make the error go away, but the connection between Cloudflare and the server will not be encrypted, and it sometimes causes a redirect loop. It is better to install a certificate on the server and stay on Full (strict).

Why did I get a 522 after moving my site to a new server?

Because the new server has a different IP address and the A record in Cloudflare still points to the old one. If the old server was stopped or deleted, Cloudflare gets no answer. Update the record to the new IP.

How long does the error take to go away after the fix?

An A record change in Cloudflare with the orange cloud on usually takes effect within minutes, because visitors connect to Cloudflare and not directly to the server. Installing a certificate or starting a service takes effect immediately. Purge the cache and test in a private window.

Sources

Official sources: Cloudflare Docs and Cloudways Knowledge Base. Written and tested by Asael Dreyer · Updated: 7 Nov 2026

Disclosure: this is an independent site, not the official Cloudways site. Some links on this site are affiliate links: if you sign up through them we earn a commission, at no extra cost to you. Full details

Picture of Asael Dreyer
Asael Dreyer

Hi, I'm Asael Dreyer, CEO of an SEO agency that runs hundreds of websites hosted on dozens of Cloudways servers.
Everything you will find here comes from hands-on experience, mine and my teams', straight from the field: from the guides to the recommendations. All to help you get the most out of Cloudways.

More about me →

Need help? Got a question about your server or this guide? Write to us and we will get back to you.

More guides on this topic:
מפריד
Thanks for your message!
We will get back to you soon.
Ready to get started?

Sign up with the coupon code ASAEL