522 Error on Server

Host is working All Okay but all of a sudden when traffic increases we see a 522 Error for cloudflare. The logs and the processing seems okay and are in the limits and normal. Not all but few people are facing this error.

Regarding Cloudflare 522 error, may I suggest you to try looking into below articles to troubleshoot the issue:

May I ask is it a PHP application or some CMS/blog like WordPress?

May I ask what SSL option have you got selected under the SSL/TLS tab at Cloudflare dashboard for your domain ( Flexible, Full, Full Strict … )?

Furthermore, kindly re-check if Cloudflare is allowed to connect to your origin host to as follows in the below article:

Cloudflare IP addresses list can be found here:

it’s a CMS build in PHP Codeigniter and have other core php code as well. It is a big Web app having multiple frameworks in it but as soon as traffic increases the server start to show 522 520 error. Previously Server resources and CPU was being used 100% . We have upgraded the CPU and other resources but still the issue is same. We changed some of the firewall configurations in cloudflare and have reverted back all the changes as well thinking that this could be the reason but still few users face 522 when there is traffic.

SSL/TLS is allowed as Full

It should be Full (Strict). Meaning: you already had a fully functioning site with HTTPS before you joined Cloudflare.

While Cloudflare is good at caching static files (images, JS, CSS), those files tend to not be big resource hogs on a server. Bandwidth, yes, CPU? not so much. But it does make for a better visitor experience to get those static resources quickly.

How much of your site requires users to be logged in? There’s a Worker that emulates a Cache Everything with Bypass Cache for specific cookies or directories:

That’s about the best you can do to offload any server load.

Caching is already implemented. Previously it was working all perfect. We then write some firewall rules and made changes to make the site more secure as a result the users started to face the 522. Images , JS and Css are being cached and minified. There’s no issue with that as well else the layout would change and we would notice. but the issue is that Cloudflare is unable to do a proper handshake with the server as soon as the traffic increases.

You just said you rolled back those changes, yet the 522 errors continue.

How many requests per second is your server experiencing?

2.2M requests in 24 hours minimum. Server is working all okay no load on server side. We rolled back all the changes. but still 522 appears sometimes.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.