
Seeing Cloudflare error 522 on your website is frustrating. Your visitors open your site and instead of your content they see a grey error page that says “Connection timed out.” The good news is that this error is usually fixable, and in most cases the problem is on the server side, not with your visitors. In this guide, you will learn what Cloudflare error 522 means, what causes it, and how to fix it step by step in 2026.
If you use Cloudflare, this error can appear suddenly after a hosting change, a firewall update, or a traffic spike. Do not change settings at random — work through the checks below in order to find the real cause quickly.
What Is Cloudflare Error 522?
Cloudflare error 522 means Cloudflare connected to your origin server, but the server did not send a response in time. Cloudflare waits for an answer, and when none arrives within its timeout window, it shows the 522 page to the visitor. In simple terms, Cloudflare itself is working, but the conversation between Cloudflare and your hosting server broke down.
Error 521 means the server refused the connection, error 523 means Cloudflare could not reach it at all, and error 524 means it started responding but took too long. With 522, the connection starts but no complete response comes back — pointing to an overloaded, blocked, or misconfigured origin.
What Causes Cloudflare Error 522?
Several common problems can trigger a 522 error. Knowing them helps you check the right place first instead of guessing:
- Overloaded server: High traffic, heavy plugins, or slow database queries can leave your server too busy to answer.
- Firewall blocking Cloudflare: Your server firewall, security plugin, or host may block Cloudflare IP addresses by mistake.
- Wrong DNS settings: An old or incorrect IP address in your DNS records sends Cloudflare to the wrong server.
- Server software crash: If PHP, MySQL, or your web server crashes, requests are accepted but never answered.
- Keep-alive disabled: Some servers close connections too early, which breaks the link between Cloudflare and the origin.
How to Fix Cloudflare Error 522: 6 Proven Steps
Step 1: Check If Your Server Is Actually Online
First, confirm your origin server is running. Check your hosting control panel for server status, or try opening your site by its direct IP address. If it loads directly but fails through Cloudflare, the problem is in the connection between the two, not your website files.
Step 2: Allow Cloudflare IP Addresses in Your Firewall
This is the most common fix. Your firewall must allow all official Cloudflare IP ranges, or it may drop Cloudflare requests silently. Add the full Cloudflare IP list to your server firewall, hosting firewall, and any security plugin allowlist. After updating the rules, clear your cache and test your site again. Many 522 errors disappear right after this step.
Step 3: Verify Your DNS Records
Log in to your Cloudflare dashboard and check your DNS records. Your A record should point to your current server IP address, especially if you recently migrated hosts or rebuilt your server. An outdated IP is a classic cause of 522 errors. Also check that you have not accidentally proxied a record, such as mail, that should stay DNS-only.
Step 4: Check Server Resources and Logs
Look at CPU, memory, and database load in your hosting panel during the time the error appears. If resources are maxed out, disable heavy plugins, optimise your database, or upgrade your hosting plan. Check your server error logs too: a crashing script or a long-running query often leaves a clear clue there.

Step 5: Review Your SSL and Server Settings
While 522 is not usually an SSL error, a misconfigured server can still break the handshake process. Make sure your web server is listening on the correct ports, that keep-alive connections are enabled, and that your origin responds on both HTTP and HTTPS as expected. If you recently changed SSL settings, revert the last change and test again.
Step 6: Pause Cloudflare to Isolate the Problem
As a diagnostic test, temporarily pause Cloudflare from the dashboard overview page. If your site loads fine without Cloudflare, the issue is in the Cloudflare-to-origin path, such as a firewall rule or DNS record. If it still fails, the problem is purely on your origin server, and your hosting provider is the right next contact. Remember to re-enable Cloudflare after testing.
How to Prevent Cloudflare Error 522 in the Future
Keep your Cloudflare IP allowlist updated, monitor server resources before traffic spikes, and avoid installing too many heavy plugins at once. Use caching, such as the free tools on KamiWeb Tools, to reduce server load, and set up uptime monitoring so you learn about errors first.
When to Contact Your Hosting Provider
Contact your host if your server keeps timing out, if you cannot access your hosting panel, or if logs show repeated crashes you cannot explain. Share the error time, the Cloudflare Ray ID from the error page, and the affected URL.
Conclusion
Cloudflare error 522 looks scary, but it almost always has a clear cause: an overloaded server, a firewall blocking Cloudflare, or a wrong DNS record. Start with server status and firewall rules, then check DNS and resources. For more fixes, explore the KamiWeb Blog and the KamiWeb homepage.
