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.

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 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
https://support.cloudflare.com/hc/en-us/articles/115003011431#521error

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

5 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
Error 521 - web server is suddenly down
My Website Server Is Down When I Use Cloudflare
Intermittent 521 outage issue - investigate by Cloudflare Ray?
SSL Activetion and show error
Error 521: Web server is down Part 2
Testing SSL by pausing Cloudflare - Godaddy hosted website
Community Tip - Email alert, origin unreachable
Error 521 Web server is down with .ru domain
AWS ALB 522 response code
Why am I having Error 521 Web server is down
I get Error 521
WWW site still not working
Always Use HTTPS
[fixed] Error 521 when server is running
Api request failed?
Getting Error 520 and 521
Hi I change ip address on DNS how long to update website
521 from cloudflare, but pausing makes site work again
Error 521 on Google Cloud Platform VM Instance
Web Server is Down
Server Unreachable
521 Error accesing my site
Server Down and web down
Error 521,Ray ID: 4e45e5f03ea513a5 • 2019-06-09 20:36:31 UTC Web server is down
Keep getting a 521 error
Yesterday's network issues
521 error if proxy activated
Wordpress Website Error 521 - cloudflare connected to Google cloud
CName Record returns 521 error
Server is up, but i see 502 and 521 error on chrome and firefox
I am getting 525 handshake error and when I did a search on whynopadloack.com every thing is alright
Apache virtual host can't resolve through cloudflare proxy
TLS set to min 1.2 on Plesk Host. Will this cause issues?
https://tlgur.com/d/GX3xx528
Getting 521 just from https request
521error please help me to solve
Nginx Reverse Proxy and Cloudflare issues
Unable to access website from South Africa
Site broke what to do urgently!
Error 521 intermittently
Web server was down error 521
Erro 521 web server is down
Error 521 | Webserver is down
Getting Error 521 - Web host says problem lies with Cloudflare
521 error CloudFlare with my websites
Cloudflare is not working with my VPS
Error 521 Webserver is down, hosting says not them
Alguno usa namecheap? error 521
Error 521 (10 chars)
Cloudflare Fails to Block Iranian Attack
South Africa - cloudflare Error 521: Web server is down
CloudFlare cannot connect to webserver on port 80
Error 521 GoDaddy and Cloudflare
We are Free Web Hosting provider and we active cloudflare but when user place order get cloudflare error
CloudFlare SSL problem
How can I solve this problem?,Error521
521 error DDos
Error 521 occur all of the sudden
521 Error sometime
Inherited a site with cloudflare
Community Tip - All Published Tips
Hostgator + CloudFlare SSL Error
`#CommunityTip 521 error
A record not propagating | Please Help
524 and 521 error
Error 521: Webserver is down, but webserver is up (and only 1 domain not working?)
GoDaddy to Cloudflare to Host
521 Error logs?
My site not work
I can't connect to the web. AWS lightsail
Turn off SSL to fix broken site
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
Site not loading after upgrade Lightsail instance
521 error, please help
Site not loading after upgrade Lightsail instance
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
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
Redirecting(help!)
Obtendo o erro 521
Issues with change name server to cloudflare
Неполадки нет доступа к сайту
Cloudflare ssl does not working
My site is completely gone! Have I been hacked? Using cloudflare and Netlify
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
CommunityTip - セキュリティに関するFAQ最初にお読みくださ
Error 521 and bluehost issue
Send email and get error 521 Upstream error
Email Routing - 550 Upstream error
Datanza.com is not redirecting to OCI load balancer IP 130.162.34.183 rather redirecting to www1.datanza.com and 4020 number only displayed on screen
Autodiscover not working
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 www.worldronemarket.com is experiencing 521 error for both front and back end
Web www.worldronemarket.com 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
Email Routing: 521 550 Upstream error. b2v5EmAvTMMj
Trying to point 2 domains at the same ip
Trailing out the Email Beta System
Site DOWNS
Error 520: web server returns an unknown error
Cloudflare Email Routing - Received Error Bounceback
Dicas da comunidade - Correção de Erro 522: Tempo limite de conexão excedido
Dicas da comunidade - Correção de Erro 520: O servidor web está retornando um erro desconhecido Alerta de e-mail, origem inalcançável
DIcas da comunidade - Correção de Erro 521: Servidor web indisponível
Autodiscover not working
Dicas da comunidade - Perguntas Frequentes de Segurança
Completely locked out by CloudFlare
Going back to index.html causes Error 521
Website down (Mozello)
Email Routes > Upstream Error
Email not forwarding
Email Routing - one address is rejecting mail (521 5.3.0 Upstream error.)
Error 521 Web server is down , any solution?
Catch-All Email not working
Cloudflare SSL with AWS Elastic Beanstalk - Error 521
Error 521 Web server is down , any solution?
Cloudflare SSL with AWS Elastic Beanstalk - Error 521
Error 521 every time but the site is up and running
Cloud.soundfm.dk 521 error
DNS A Record points to Digital Ocean Droplet WordPress throwing 521 Error
[Email Routing] "No such user here" with aliases registered
DNS A Record points to Digital Ocean Droplet WordPress throwing 521 Error
Reverse proxy via nginx - CloudFlare SSL
Error 521 in Full SSL
Reverse proxy via nginx - CloudFlare SSL
Email Routing is error 521
Error 521 wordpress-cloudflare connection
Error 521 using nginx on synology as a host
Email (beta) routing not working
Email (beta) routing not working
Email (beta) routing not working
Email (beta) routing not working
Email (beta) routing not working
Email (beta) routing not working
More error code history logging insight for 521, 522, 525 like errors
Email Routing: 550 5.0.350 Remote server returned an error
Error 521 - Cloudfare and NPM
[warn] RSA server certificate CommonName (CN) `CloudFlare Origin Certificate' does NOT match server name!?
[warn] RSA server certificate CommonName (CN) `CloudFlare Origin Certificate' does NOT match server name!?
HELP both domains email no longer working!
Error 521 - Cloudfare and NPM
Email routing giving "521 5.3.0 Upstream error. TuhicvK1UwOp" error
CommunityTip - Khắc phục lỗi 522: Đã hết thời gian kết nối
Email routing giving "521 5.3.0 Upstream error. TuhicvK1UwOp" error
Email (beta) routing not working
Changes in DNS are not being reflected after 24 hours
Subdomain linking to IP address doesn't work
How to set SSL for Google cloud wordpress
Cloudflare can't point to the interface of FortiGate
Can't post anything
社區提示 - 安全性常見問題
CommunityTip - Correction de l'erreur 522 : la connexion a expiré
Cloudflare IIS Proxy Error
Dicas da comunidade - Todas as dicas
Since Rogers was down our websites are not loading correcting with Proxy on
Cloudflare IIS Proxy Error
Email Routing: Bouncing with Upstream Error
Redirect page loop for wordpress installation
DNS not updating, please help :(
社區提示 - 修復「錯誤 522:連線逾時」
Error 521: Host Error
Cloudflare Pages - Failed: an internal error occurred
TipsKomunitas - Memperbaiki Kesalahan 522: Koneksi mencapai batas waktu
TipsKomunitas - Memperbaiki Kesalahan 521: Server web tidak bekerja
TipsKomunitas - Pertanyaan Umum Keamanan
Email Routing: 521 550 Upstream error. b2v5EmAvTMMj
社區提示 - 修復「錯誤 521:網頁伺服器當機」
社區提示 - 修復「錯誤 520:網頁伺服器傳回未知錯誤」
Error 521 Web server is down (printingplanetuk.com)
ERROR 521 no no no
CommunityTip - Câu hỏi thường gặp về bảo mật
.dev domain issues
.dev domain issues
커뮤니티 팁 - Error 522: Connection timed out 해결
ERROR 521 no no no
커뮤니티 팁 - Error 520: Web server is returning an unknown error 해결
커뮤니티 팁 - Error 521: Web server is down 해결
CommunityTip - Khắc phục lỗi 520: Máy chủ web trả về một lỗi không xác định
Full strict origin server ssl config and
เคล็ดลับชุมชน - การแก้ไขข้อผิดพลาด 521: เว็บเซิร์ฟเวอร์ล่ม
Error 521: Webserver is down, but webserver is up (and only 1 domain not working?)
Error 521: Webserver is down, but webserver is up (and only 1 domain not working?)
My site is not listed as a partner hosted zone but the rest of my sites are
เคล็ดลับชุมชน - คำถามที่พบบ่อยเกี่ยวกั บการรักษาความปลอดภัย
Error 521 on site NOT using Cloudflare
TipsKomunitas - Memperbaiki Kesalahan 520: Server web mengembalikan kesalahan yang tidak diketahui
Error 522: Check Workers Routes
コミュニティのヒント - 「エラー521: web server is down (Webサーバーがダウンしています)」を解決するには、
コミュニティのヒント - 公開されているすべてのヒント
Our website maybe attacking by HTTP flood attack
Error 521 code 1001
Error 521 code 1001
Error 521 code 1001
Cloudflare A record to Lightsail Plex server not working
社区提示 - 修复错误 521:Web 服务器已关闭
社区提示 - 安全常见问题
Cloudflare return 521
Error 501 Webserver is down I'm not sure what to do
Error 501 Webserver is down I'm not sure what to do
社区提示 - 所有提示
社区提示 - 修复错误 520:Web 服务器返回未知错误
社区提示 - 修复错误 522:连接超时
CommunityTip - Todas la CommunityTips
커뮤니티 팁 - 보안 faq
CommunityTip - Solucionar el error 521: El servidor web no funciona
Error 521 and error 503 cloudflare-nginx, help!
Error 521 with proxy
CommunityTip - Corrección del error 522: se agotó el tiempo de espera de la conexión
Ipv6 only host can not been connected in fetch()
Email Routing not working when using catch-all
CommunityTip - FAQ sur la sécurité
Error 521 and error 503 cloudflare-nginx, help!
CommunityTip - Tous les conseils
CommunityTip - Résoudre Error 521: Web server is down
CommunityTip - Correction de l'erreur 520 : le serveur Web renvoie une erreur inconnue
Consigli della community - Risolvere Error 522: Connection timed out
Consigli della community - Risolvere Error 520: Web server is returning an unknown error
Consigli della community - Risolvere Error 521: Web server is down
Receiving a 521 error message
Receiving a 521 error message
Problems with Cloudflare's Newark Data Center
Problems with Cloudflare's Newark Data Center
Pointing subdomain
Email Routing not working when using catch-all
Pointing subdomain
Erro 521 Servidor da Web Inoperante
Getting 521 server error
521 on my site
เคล็ดลับชุมชน - การแก้ไขข้อผิดพลาด 520: เว็บเซิร์ฟเวอร์กำลังส่งคืนข้ อผิดพลาดที่ไม่รู้จัก
Советы сообщества - Исправление ошибки 520: Веб\-сервер возвращает неизвестную ошибку
Советы сообщества - Исправление ошибки 522: Соединение прервалось
Советы сообщества - Часто задаваемые вопросы о безопасности
Problem with SSL :S
High number of 521 error
Strange 521 error
521 Error - hosting error
Советы сообщества - Исправление ошибки 521: Веб\-сервер не работает
My siteis popping out Error 521
Error 521 but works when CF is disabled
My siteis popping out Error 521
There was an error on our website Error 521 link to the website http://kinoworld.club/. 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 sitemeer.com 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
About the Italiano category
Error: "This site can’t be reached"
Total confusion
521 after updating nginx
Не могу подключиться
CommunityTip - Behebung von Fehler 522: „Connection timed out“
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
CommunityTip - Behebung von Fehler 521: „Web server is down“
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
เคล็ดลับชุมชน - การแก้ไขข้อผิดพลาด 522: การเชื่อมต่อหมดเวลา
SSL Certificate isn't getting recognised Full (Strict)
How to fix Error 521
CommunityTip - Behebung von Fehler 525: „SSL handshake failed“
My website is showing Error 521
コミュニティのヒント - エラー522:接続がタイムアウトしました
コミュニティのヒント - エラー520:Webサーバーが不明なエラーを返しています
CommunityTip - Preguntas frecuentes sobre seguridad
CommunityTip - Solucionar el error 520: El servidor web devuelve un error desconocido
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