Community Tip - Fixing Error 521: Web server is down

Error
Try the suggestions in this Community Tip to help you fix Error 521: Web server is down.

Background
A 521 error happens when we are unable to make a TCP connection to your origin server. Specifically, Cloudflare tried to connect to your origin server on port 80 or 443, but received a connection refused error. This is often caused by security or firewall software and happens if the origin server has directly refused Cloudflare’s proxy request.

Quick Fix Ideas

  1. Check your origin web server. The origin web server might not be running; in that case you should: a) Ensure your web server is running normally and b) Review the server’s error logs to see what is causing the error. If you’re unable to perform these tasks, contact your hosting provider.

  2. If you have just moved to Cloudflare and you are seeing a 521 over HTTPS, it is possible that your origin server has not been configured to allow port 443 be accessed by Cloudflare IPs. In this case you should configure your server/firewall to being listening on port 443 and allow us to be able to conect. If this is not possible, you can move to using ‘Flexible’ SSL under the SSL/TLS app on the dashboard.

  3. Make sure that you’re not blocking Cloudflare IPs in .htaccess, iptables , or your firewall.

  4. Make sure your hosting provider isn’t rate limiting or blocking IP requests from the Cloudflare IPs and ask them to whitelist the IP addresses https://www.cloudflare.com/ips.

  5. Make sure that you’re operating off of the most recent versions of Bad Behavior or mod_security. mod_security’s core rules aren’t blocking Cloudflare requests.

  6. If you are running custom Apache modules, such as mod_antiloris and mod_reqtimeout, disable and unload the modules. These modules will block any time an IP that connects more than 22 times. Since all connections are now coming from a Cloudflare IP, you will definitely hit the limit causing the error page. As soon as you unload the module, the issue will disappear.

  7. If your firewall is configured to DROP packets rather than refuse connections, it will cause a 521; meaning an incorrectly configured firewall can actually masquerade as a connection timeout 522 error.

  8. If you’re 521 errors when using Workers to load Javascript on a site, note that Workers subrequest can override the DNS origin address by making subrequest to external site. Check the script to confirm you’re testing the correct origin server.

  9. If you see the error railgun.wan_error connection failed it indicates you have a faulty Railgun configuration, disable Railgun and visit your site.

Lite Reading

Background Resources
Help Center
YouTube

Research The Issue
Community
Google

If You Need More Help
This community of other Cloudflare users may be able to assist you, login to Cloudflare and post your question to the Community. When you post on the Community make sure to include as much of this information as possible: the specific error message you are seeing, the URLs this is happening on, screen shot of the error, and the steps to reproduce the error. Please indicate what troubleshooting steps you’ve tried in order to help us help you.

This is a Cloudflare Community Tip, to review other tips click here.

Çevirmek…traduzir…翻译…traducir…Traduire…Übersetzen…:greyg: Translate this Tip

FXCTWS 101119

6 Likes
521 Error on single page route
521 Error, but I can access IP directly and It even works on another domain
Error 521 Ray ID: 47ed58c1db7f989b • 2018-11-24 16:45:34 UTC
GETTING 521 ERROR: domain not pointing to the origin server
IP resolving issue
Error 521 on my website
Error 521 Server Down
My Website Server Is Down When I Use Cloudflare
Error 521 - web server is suddenly down
SSL Activetion and show error
Community Tip - Email alert, origin unreachable
Testing SSL by pausing Cloudflare - Godaddy hosted website
WWW site still not working
Why am I having Error 521 Web server is down
Error 521: Web server is down Part 2
Intermittent 521 outage issue - investigate by Cloudflare Ray?
Always Use HTTPS
Error 521 Web server is down with .ru domain
I get Error 521
Yesterday's network issues
Web Server is Down
521 error if proxy activated
[fixed] Error 521 when server is running
Server Unreachable
Error 521 on Google Cloud Platform VM Instance
AWS ALB 522 response code
Api request failed?
Error 521,Ray ID: 4e45e5f03ea513a5 • 2019-06-09 20:36:31 UTC Web server is down
Getting Error 520 and 521
Hi I change ip address on DNS how long to update website
Keep getting a 521 error
521 Error accesing my site
Server Down and web down
521 from cloudflare, but pausing makes site work again
https://tlgur.com/d/GX3xx528
Getting 521 just from https request
Server is up, but i see 502 and 521 error on chrome and firefox
CloudFlare cannot connect to webserver on port 80
Hostgator + CloudFlare SSL Error
521 Error sometime
We are Free Web Hosting provider and we active cloudflare but when user place order get cloudflare error
Alguno usa namecheap? error 521
521error please help me to solve
Getting Error 521 - Web host says problem lies with Cloudflare
Error 521 GoDaddy and Cloudflare
Inherited a site with cloudflare
Community Tip - All Published Tips
521 error CloudFlare with my websites
Turn off SSL to fix broken site
I am getting 525 handshake error and when I did a search on whynopadloack.com every thing is alright
Nginx Reverse Proxy and Cloudflare issues
Unable to access website from South Africa
South Africa - cloudflare Error 521: Web server is down
CloudFlare SSL problem
Site broke what to do urgently!
A record not propagating | Please Help
Cloudflare Fails to Block Iranian Attack
Wordpress Website Error 521 - cloudflare connected to Google cloud
524 and 521 error
My site not work
`#CommunityTip 521 error
Cloudflare is not working with my VPS
Error 521 | Webserver is down
Erro 521 web server is down
Web server was down error 521
Error 521 intermittently
CName Record returns 521 error
I can't connect to the web. AWS lightsail
521 Error logs?
GoDaddy to Cloudflare to Host
Apache virtual host can't resolve through cloudflare proxy
TLS set to min 1.2 on Plesk Host. Will this cause issues?
Error 521 Webserver is down, hosting says not them
Error 521 (10 chars)
521 error DDos
Error 521 occur all of the sudden
How can I solve this problem?,Error521
Issues with Error 521 on my site
My site keeps going down Error 521
HTTPS redirect not working for one of the urls linked to my domain
How to handle 504 and 521 Errors
Issues in Amsterdam? Errors 521?
My website is down, doesn't connect to host?
Error 521: Web server is down
Erro 521 Servidor da Web Inoperante
Error 521 and 530
Inquiries about resolution for 521 error
I cannot Access my Website and the Wp Admin
Error 521 AWS after creating AMI
521 Webserver down
Wordpress multisite subsites problem with login and cookies
Error 521 when web server is fully responsive
My site shows 521 error but sitemeer.com says it is up
HTTP 520 Errors still persisting
521 - web server down
Cloudflare states webserver is down although reachable through ip
Getting 521 error sometimes and then resolves itself after few mins
Erro 521 When SSL FULL
Error 521 Horror - losing $1 000 000 per hour
Issue with my vps and dns settings
Error 521 web server down only when editing Wordpress posts (Cloudflare + WP Bakery + WPML)
My domain works for about 30 seconds and then stop working
SSL Certificate isn't getting recognised Full (Strict)
SSL not working on subdomain
Como conectar mi droplet de digital ocean
Error 521 Web Server Down
How to fix Error 521
521 error, can anyone help me?
My website is showing Error 521
521 error, can anyone help me?
High number of 521 error
Jetpack / WooCommerce connection issues
CF giving out one valid and one invalid DNS resolution
Obtendo o erro 521
Error 521 on website
Website unresponsive
Nonstop 521 and 524 Errors
Please help with Error 521
I have added my website to cloudflare but it is showing error 521 since yesterday
Changed DNS and now get 521 error with cloudflare on, but not with it turned off
Problem with SSL :S
Неполадки нет доступа к сайту
Не могу зайти на сайт
Fixing Errors 521 and 525! (Tutorial)
Cloudflare load balancer 521 error but my server is ok
521 error page
Host not getting resolved when IP is proxied
Sub Domain is not working with different IP Address
Any solution to 521 error?
Plz fix my 521 error
Error 521 Ray ID: 47ed58c1db7f989b • 2018-11-24 16:45:34 UTC
Status re-routed São Paulo / Brazil
Website down after changing name server IP
There was an error on our website Error 521 link to the website http://kinoworld.club/. Help me deal with the problem
Cloudflare does not working
I can't access my website after changing cloudflare account
Repeated host errors
Cloudflare ssl does not working
521 error, please help
Error 521 but works when CF is disabled
521 on my site
Error 521 and bluehost issue
All or most requests from Romania are met with error 521
DNS record issue, CNAME and A record updated, error 521
Why access to the server is closed
Error 521 - Unable to have support
Getting 521 server error
Redirecting(help!)
Point the domain to a VPS
How do you serve a 429 response with CloudFlare (or other custom response code)?
Site down after cloudflare DNSSEC
Unable to access my website Error 521
Server Unreachable at domain
Webserver is not opening via domain which is on CF
Error: "This site can’t be reached"
521 Error - hosting error
Total confusion
521 after updating nginx
Не могу подключиться
521 error with DNS proxied but another site on same host working fine
SSL Problem After removed it
CommunityTip - Security FAQ Read Me First
VPS ip in DNS make 521 error
Strange 521 error
Community Tip - Helpful Links, on Display
Код ошибка 521
Nginx Reverse Proxy and Cloudflare issues
Sites are down after expiry date and updating
Unusual 521's with firewall whitelists
Revolving 521 error
Urgent! Please Help
I'm getting Error 521 but disabling cloudflare solves the problem
Cloudflare and ssl on apache2 521 Web server is down
Status 520/521
Error 521 to specific links
Cannot access website, error 521
"A" record does not work ! (521 status code)