Last updated: · By Asael Dreyer
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
| Code | What happened | Common cause on Cloudways | First check |
|---|---|---|---|
| 521 | The server refused the connection from Cloudflare | Stopped server, web service down, Cloudflare IPs blocked | Is the server running in the platform? |
| 522 | Cloudflare waited for the server and got no response | A record pointing to an old IP, overloaded server, firewall | Is the IP in Cloudflare the same as the server IP? |
| 525 | The SSL handshake between Cloudflare and the server failed | No valid certificate on the server, in Full or Full (strict) mode | The 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.
- 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.
- 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.
- 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.
- In the platform, make sure the server is not in a Stopped state. A stopped server accepts no connections at all.
- 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.
- Check that you have not blocked Cloudflare addresses, as with error 522.
- 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.
- In the platform, open the application > SSL Certificate and check whether a certificate is installed and when it expires.
- 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.
- 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.
- 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.
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).
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
Start a free trial server, no credit card. When you move to a paid plan, the code ASAEL takes 30% off your bill for the first three months.
The link fills in the code on the signup form. Just make sure it shows up.
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
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.
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.
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.
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).
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.
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.
Related guides
- Connecting a Cloudflare domain to Cloudways
- SSL errors on Cloudways and how to fix them
- 502 and 504 errors: what to check
- Hardening security on Cloudways
- Cloudways review: who it is for
- All guides on this topic: Domains and SSL
Sources
- Error 521, Error 522, Error 525 – Cloudflare Docs
- Encryption modes – Cloudflare Docs
- IP Ranges – Cloudflare (15 IPv4 ranges and 7 IPv6 ranges, checked 7 Nov 2026)
- How to Configure Cloudflare Origin Certificate – Cloudways KB
- Fix Issue of Let’s Encrypt SSL Not Renewing Automatically – Cloudways KB
- How to Clone Your Server – Cloudways KB
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