Community Tip - Fixing Error 521: Web server is down

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

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.

Banner in tip catalog

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

  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

Research The Issue

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

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
Testing SSL by pausing Cloudflare - Godaddy hosted website
Error 521 - web server is suddenly down
Community Tip - Email alert, origin unreachable
SSL Activetion and show error
Error 521: Web server is down Part 2
WWW site still not working
Error 521 Web server is down with .ru domain
I get Error 521
Intermittent 521 outage issue - investigate by Cloudflare Ray?
Always Use HTTPS
Why am I having Error 521 Web server is down
Getting Error 520 and 521
[fixed] Error 521 when server is running
Error 521 on Google Cloud Platform VM Instance
Server Down and web down
Error 521,Ray ID: 4e45e5f03ea513a5 • 2019-06-09 20:36:31 UTC Web server is down
AWS ALB 522 response code
Server Unreachable
Keep getting a 521 error
521 from cloudflare, but pausing makes site work again
Web Server is Down
521 Error accesing my site
Hi I change ip address on DNS how long to update website
Api request failed?
Yesterday's network issues
521 error if proxy activated
Community Tip - All Published Tips
CloudFlare cannot connect to webserver on port 80
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
Alguno usa namecheap? error 521
Cloudflare Fails to Block Iranian Attack
Hostgator + CloudFlare SSL Error
Apache virtual host can't resolve through cloudflare proxy
TLS set to min 1.2 on Plesk Host. Will this cause issues?
Getting 521 just from https request
Wordpress Website Error 521 - cloudflare connected to Google cloud
521 Error sometime
Error 521 Webserver is down, hosting says not them
Error 521 (10 chars)
Turn off SSL to fix broken site
I am getting 525 handshake error and when I did a search on every thing is alright
521 error DDos
Error 521 occur all of the sudden
How can I solve this problem?,Error521
Nginx Reverse Proxy and Cloudflare issues
Unable to access website from South Africa
521error please help me to solve
South Africa - cloudflare Error 521: Web server is down
Getting Error 521 - Web host says problem lies with Cloudflare
524 and 521 error
CloudFlare SSL problem
Error 521 GoDaddy and Cloudflare
My site not work
Server is up, but i see 502 and 521 error on chrome and firefox
Inherited a site with cloudflare
`#CommunityTip 521 error
Site broke what to do urgently!
A record not propagating | Please Help
We are Free Web Hosting provider and we active cloudflare but when user place order get cloudflare error
521 error CloudFlare with my websites
Cloudflare is not working with my VPS
Error 521 | Webserver is down
Erro 521 web server is down
521 error with DNS proxied but another site on same host working fine
Our website down with Error 521
I'm getting Error 521 but disabling cloudflare solves the problem
Issues with Error 521 on my site
Como conectar mi droplet de digital ocean
Fixing Errors 521 and 525! (Tutorial)
Occasional 521 errors
Website down after changing name server IP
I can't access my website after changing cloudflare account
Error 521 after changing the Host
Repeated host errors
Obtendo o erro 521
Неполадки нет доступа к сайту
Cloudflare ssl does not working
Problems changing the server
Error 521 - website not available
521 through only SG
Rise in 521 Errors on All Site Connected to Cloudflare
Community Tip - Sicherheits-FAQ
Community Tip - Alle veröffentlichten Tipps
Community Tip - 公開されているすべてのヒント
CommunityTip - セキュリティに関するFAQ最初にお読みくださ
Error 521 and bluehost issue
Send email and get error 521 Upstream error
Email Routing - 550 Upstream error is not redirecting to OCI load balancer IP rather redirecting to and 4020 number only displayed on screen
Domain down server ip is ok after cloudflare
Domain down server ip is ok after cloudflare
Community Tip - Fixing Error 522: Connection timed out
Getting 521 error code on legal connection
Error 521: Web server is down
Web is experiencing 521 error for both front and back end
Web is experiencing 521 error for both front and back end
Terraform and CloudFlare for Teams, Gateway Policies
Trailing out the Email Beta System
Getting 521 error code on legal connection
Trying to point 2 domains at the same ip
CDN not working correctly anymore
Trailing out the Email Beta System
Trying to point 2 domains at the same ip
Trailing out the Email Beta System
Error 520: web server returns an unknown error
Erro 521 Servidor da Web Inoperante
Cloudflare Email Routing - Received Error Bounceback
Getting 521 server error
521 on my site
Problem with SSL :S
High number of 521 error
Strange 521 error
521 Error - hosting error
Error 521 but works when CF is disabled
There was an error on our website Error 521 link to the website Help me deal with the problem
Error 521 Ray ID: 47ed58c1db7f989b • 2018-11-24 16:45:34 UTC
Plz fix my 521 error
Any solution to 521 error?
Cloudflare load balancer 521 error but my server is ok
Не могу зайти на сайт
Changed DNS and now get 521 error with cloudflare on, but not with it turned off
Please help with Error 521
521 error, can anyone help me?
521 error, can anyone help me?
Error 521 Web Server Down
SSL not working on subdomain
Error 521 web server down only when editing Wordpress posts (Cloudflare + WP Bakery + WPML)
Cloudflare states webserver is down although reachable through ip
521 - web server down
HTTP 520 Errors still persisting
My site shows 521 error but says it is up
521 Webserver down
My site keeps going down Error 521
Unusual 521's with firewall whitelists
Sites are down after expiry date and updating
Nginx Reverse Proxy and Cloudflare issues
Код ошибка 521
Server Unreachable at domain
Error: "This site can’t be reached"
Total confusion
521 after updating nginx
Не могу подключиться
SSL Problem After removed it
CommunityTip - Security FAQ Read Me First
VPS ip in DNS make 521 error
Community Tip - Helpful Links, on Display
Revolving 521 error
Urgent! Please Help
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)
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 and 530
Inquiries about resolution for 521 error
I cannot Access my Website and the Wp Admin
Error 521 AWS after creating AMI
Wordpress multisite subsites problem with login and cookies
Error 521 when web server is fully responsive
Trailing out the Email Beta System
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
My domain works for about 30 seconds and then stop working
SSL Certificate isn't getting recognised Full (Strict)
How to fix Error 521
My website is showing Error 521
Jetpack / WooCommerce connection issues
CF giving out one valid and one invalid DNS resolution
Error 521 on website
Website unresponsive
Nonstop 521 and 524 Errors
I have added my website to cloudflare but it is showing error 521 since yesterday
521 error page
Host not getting resolved when IP is proxied
Sub Domain is not working with different IP Address
Status re-routed São Paulo / Brazil
Cloudflare does not working
521 error, please help
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
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
Webserver is not opening via domain which is on CF