Cloudflare errors 520 to 526: what each number says about your server

The short answer: a 52x error carrying Cloudflare’s name means Cloudflare arrived, but could not talk to your server (or talked badly). The site itself may or may not be fine: the number says where to look. The most common are 521 (server refuses), 522 (does not answer in time), 525 and 526 (certificate problems).

What the site needs

What What to do
520 An empty or odd answer from the server. A program that fails halfway or a firewall cutting off.
521 The server refused the connection: it is stopped, or a firewall blocks Cloudflare.
522 and 524 The server did not answer in time (522) or took too long to answer (524): slow, overloaded or unreachable.
523 Cloudflare cannot find the server: the IP address in the DNS is wrong or has changed.
525 and 526 The encryption handshake failed (525) or the server’s certificate is invalid (526). It has to do with the SSL mode: Switching on SSL at Cloudflare.

Getting started

1 Test without Cloudflare: set the site’s record to “DNS only” (grey cloud) for a few minutes. If the site opens, the problem is in the link between the two.
2 Check the IP in Cloudflare’s DNS: it must be your server’s, which may have changed: Putting a domain on Cloudflare.
3 Look at the firewall: it must not block Cloudflare’s addresses, or your server stops seeing them: IP blocked by the firewall.
4 For 525 and 526, set the right SSL mode (“Full”) and check the server’s certificate is valid: Expired certificate.
5 For 522 and 524, the server is slow: 502 and 504.
Do not leave Cloudflare on “DNS only” for good out of tiredness. You lose the protection and the cache. Find the cause and turn the proxy back on. And be careful changing the SSL mode blindly: Redirect loops.
When Cloudflare helps and when it gets in the way: Cloudflare, and the options that cause work: The options worth having.

A 52x error that will not go away? Open a ticket with the address and the exact number.

Open a support ticket

SEE ALSO

Cloudflare: when it helps, how to switch it on, and the cache that fools you

Switching on SSL at Cloudflare without breaking the site

The Cloudflare options worth having, and the ones that cause trouble

Putting a domain on Cloudflare

Certbot renewal failed or the certificate expired: how to find out why

ERR_TOO_MANY_REDIRECTS: when the site redirects in a circle

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $6.59/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?