Nothing is more stressful than opening your website and seeing a full-screen Cloudflare Error 521, 522, or 524 host error screen. Because Cloudflare sits between your visitors and your hosting provider, these 52x error codes mean one thing: Cloudflare’s edge network is working, but your origin web hosting server failed to respond properly.
Before changing random settings, you can immediately test your domain’s current DNS and hosting response using our free Website IP & Hosting Detector and DNS & SSL Checker.
Quick Comparison: Error 521 vs 522 vs 524
| Error Code | Official Name | Root Cause on Shared/Free Hosting |
|---|---|---|
| Error 521 | Web Server Is Down | Origin server refused the connection (Apache/Nginx offline, firewall blocking Cloudflare, or wrong IP in DNS). |
| Error 522 | Connection Timed Out | Origin server did not respond within 15 seconds (CPU limit reached, entry processes full, or overloaded shared node). |
| Error 524 | A Timeout Occurred | Server accepted the connection but PHP/MySQL took over 100 seconds to finish generating the page. |
Step 1: Verify Your DNS A Record & SSL Mode (Fixes 50% of 521/522 Errors)
When you migrate a website or reset a free hosting account, your server IP address often changes without warning. If Cloudflare still points to an old or mistyped IP address, visitors will see Error 521 or Error 522.
- Open your hosting control panel (cPanel, DirectAdmin, or hPanel) and copy your Shared IP Address.
- Run a live check on your domain in our Free DNS Lookup & SSL Checker.
- In your Cloudflare Dashboard under SSL/TLS → Overview, switch encryption mode to Full (Strict) if you have an SSL certificate installed on your host, or Flexible only if your free host does not support HTTPS on port 443.
Step 2: Fix Error 522 (Connection Timed Out) on Shared Hosting
Error 522 is the most common error on free and ultra-cheap shared hosting. It occurs when too many concurrent requests hit your account and exhaust your Entry Processes (EP) or CPU Limit.
- Enable Cloudflare Caching & Bot Fight Mode: In Cloudflare, go to Security → Bots and turn on Bot Fight Mode. Bad bots and scrapers frequently overwhelm free hosting CPU limits.
- Check Resource Usage in cPanel: Look at CPU and Concurrent Connection Usage. If you see red faults, read our guide on What CPU Limit Exceeded Means in Hosting.
- Whitelist Cloudflare IPs in `.htaccess`: Ensure no security plugin (like Wordfence or iThemes) is rate-limiting Cloudflare’s proxy IPs. You can generate clean `.htaccess` rules with our Free .htaccess Generator.
Step 3: Fix Error 524 (PHP & Database Timeout)
If you only see Error 524 when importing posts, running WooCommerce, or saving heavy pages in WordPress, your PHP scripts are stalling:
- Deactivate heavy backup, broken-link checker, or statistics plugins that run inside WordPress.
- Optimize your database tables (`wp_options` autoloaded data and post revisions).
- If your host throttles MySQL queries, use our Hosting Upgrade Decision Tool to check if your site has outgrown free hosting limits.
Frequently Asked Questions (FAQ)
What causes Cloudflare Error 522 on shared or free hosting?
Error 522 (Connection Timed Out) happens when Cloudflare cannot complete a TCP handshake with your origin web server within 15 seconds—usually because your shared host is overloaded, hitting CPU/entry process limits, or blocking Cloudflare IP ranges.
How do I fix Error 521 Web Server Is Down?
First verify your DNS A record points to the correct server IP using a DNS Lookup tool, check if your hosting account is suspended or rebooting, and ensure port 443 is open with a valid SSL certificate.
Why do I get Error 524 A Timeout Occurred in WordPress?
Error 524 means Cloudflare connected to your server, but your server took longer than 100 seconds to send an HTTP response—commonly caused by heavy WordPress plugins, unoptimized database queries, or PHP worker exhaustion.