6 Methods To Repair Cloudflare’s Error Code 521 in WordPress

You being right here means that your web site’s guests are getting error code 521 once they enter the URL within the browser — i.e., your web site is inaccessible to your prospects.

Figuring out that such a downtime can value greater than $300,000 for 91 % of enterprises, let’s rapidly determine what error 521 means and tips on how to troubleshoot it.

Right here’s what we’ll cowl:

Error code 521

Error code 521, or “Error 521: Net server is down,” is an error your guests see if Cloudflare can’t entry your web site’s server. In different phrases, your guests can attain the servers of your content material supply community (CDN), however the CDN can’t attain you.

Widespread causes of this error embody an unavailable internet server, a misconfigured Cloudflare configuration, or an invalid Safe Sockets Layer (SSL) certificates.

repair error code 521

Now that we all know what error 521 is, let’s see tips on how to troubleshoot it.

1. Confirm that your web site is on-line

Whenever you arrange Cloudflare as a reverse proxy on your web site’s server, it acts as a bridge between your prospects and your web site. Your web site guests cross via this bridge to seek out your web site on the opposite finish.

In case your guests encounter error 521, the very first thing you should do is examine if the bridge’s vacation spot continues to be on-line.

You should use the cURL command to work together straight along with your web site’s server and request a response.

Open the command immediate or terminal (if utilizing macOS or Linux) and enter the next code:

curl –silent –output /dev/null –write-out “%{http_code}” https://yourwebsite.com

Word: Exchange “https://yourwebsite.com” along with your web site’s URL.

You’ll get an output within the type of an HTTP standing code. If it’s 200, your web site server is on-line.

For example, right here’s the output of this code if we use cURL to work together with our web site.

For those who don’t wish to work with the command immediate or terminal, check out KeyCDN’s HTTP Header Checker.

Nonetheless, getting a 5xx standing code means the server failed to reply to your request — and you’ve got a server error.

Word: For those who get HTTP code 301, don’t fear. It implies that WordPress has arrange a 301 redirect for non-WWW to WWW URL, or vice versa. That sometimes occurs in case your web site’s default deal with is “https://www.nexcess.web,” and also you enter “https://nexcess.web.” Chances are you’ll enter the right deal with to get the precise response code.

In case of a server subject, carry it up with the internet hosting supplier’s assist crew to see in the event that they’re doing any upkeep on the server. It’s also possible to examine your internet hosting supplier’s standing web page to see if the servers are offline.

Alternatively, in case your internet hosting supplier doesn’t supply fast assist, chances are you’ll try the error logs by way of cPanel to troubleshoot the server points.

In case your internet hosting supplier’s servers undergo from frequent downtimes, take into account Nexcess. We reliably supply nearly 100% uptime with all our internet hosting plans. Moreover that, our knowledgeable assist crew is obtainable 24/7/365 that can assist you with any technical points.

2. Take away blockers between Cloudflare and your web site

In case your web site is on-line, the error 521 is perhaps because of a misconfiguration stopping Cloudflare from accessing your web site’s recordsdata.

The difficulty might be in your .htaccess file, IP Blocker guidelines, or safety plugin. Let’s see tips on how to repair each.

Whitelist Cloudflare IP addresses in your .htaccess file

Cloudflare makes use of a set of IP addresses to direct incoming site visitors to your internet server. Guarantee all these IP addresses are whitelisted or allowed in your internet server.

Right here’s tips on how to whitelist IP addresses within the server configuration:

1. Open the .htaccess file by way of an FTP consumer or utilizing the file supervisor in cPanel.

2. Add the next code:

order deny, enable
deny from all

3. Add enable from [Cloudflare IP addresses]. Exchange [Cloudflare IP addresses] with one of many precise IP addresses on every line, as proven within the picture under.

4. Save your .htaccess file.

Verify IP Blocker settings

For those who’re utilizing a cPanel-based host, IP Blocker may help you block your web site from a selected IP deal with or a spread of IP addresses.

Assessment the IP Blocker settings to make sure one of many admins hasn’t added Cloudflare IP ranges to it by mistake.

Disable your safety plugin

There’s an opportunity your safety or firewall plugin is perhaps blocking Cloudflare requests. To rule that risk out, disable the plugin and see if it resolves error 521. If it does, contact the plugin builders or change your safety plugin.

3. Assessment Cloudflare DNS settings

Log in to your Cloudflare account and navigate to [yourwebsite.com] > DNS > Data.

As soon as there, be certain that content material for all A data matches the origin internet server’s IP deal with and that the content material for CNAME data incorporates your web site’s area identify.

If one of many data is inaccurate, chances are you’ll modify the document by clicking Edit.

4. Set up a sound SSL on the origin internet server

For those who’ve configured the SSL/TLS settings on Cloudflare as Full (strict), Cloudflare performs a certificates validation between itself and your server.

And in case your web site’s SSL certificates comes throughout as expired or self-signed or doesn’t match the area, Cloudflare will reduce off the connection. In that case, your guests will see error 521 of their internet browser.

Chances are you’ll want to put in a Cloudflare Origin Certificates Authority (CA) certificates in your server to repair this subject. You may get a Cloudflare Origin CA certificates by navigating to [yourwebsite.com] > SSL/TLS > Origin server and clicking Create certificates.

Afterward, you possibly can add the Cloudflare origin certificates to your internet server by following your internet hosting supplier’s instructions.

Nonetheless, should you handle delicate information or have to adjust to PCI-DSS necessities, chances are you’ll be higher off with a premium SSL certificates.

5. Deactivate mod_reqtimeout and mod_antiloris

You might need enabled mod_reqtimeout and mod_antiloris modules in your Apache HTTP server to forestall denial-of-service (DoS) and distributed denial-of-service (DDoS) assaults. The modules defend your internet server from these assaults by limiting the variety of occasions an IP server can join along with your server.

Whereas mod_reqtimeout and mod_antiloris function a protecting defend on your internet hosting server, they could have incompatibility points with Cloudflare.

For example, Cloudflare depends on a restricted variety of IP addresses to direct site visitors to your server, however the modules would possibly block these addresses because of consecutive connection makes an attempt.

6. Contact buyer assist

If not one of the options above give you the results you want, it’s time to get outdoors assist.

Get Cloudflare’s assist by way of ticket, chat, or cellphone by navigating to Assist > Contact Cloudflare in case your web site capabilities wonderful with out Cloudflare’s CDN.

If the web site’s internet hosting server is down, contact your website hosting supplier’s assist crew. With Nexcess, you get 24/7/365 assist from knowledgeable technicians who deal with the troubleshooting from begin to end and allow you to give attention to different enterprise duties.

Last ideas: 6 methods to repair Cloudflare’s error code 521 in WordPress

For those who personal an ecommerce enterprise or handle an enterprise, you don’t wish to preserve seeing error code 521 for lengthy. Each second your web site stays inaccessible, you permit more cash on the desk.

With the information above, you possibly can attempt to repair the error as quickly as attainable. Nonetheless, prevention is healthier than treatment.

At Nexcess, our specialists deal with the server configuration for you, so that you hardly ever have to fret about an error 521. To not point out, our enterprise internet hosting plans include 24/7/365 assist from elite technicians, at all times on standby if something breaks free.

Moreover that, you too can strive our free built-in Nexcess Edge CDN, which is powered by Cloudflare, to bypass error code 521 since Nexcess specialists deal with every thing, versus Cloudflare itself, the place it’s a must to configure the CDN manually.

Take a look at our internet hosting plans to get began in the present day.