Article ID: 128203, created on Jan 30, 2016, last review on Jun 17, 2016

  • Applies to:
  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux


  • When you visit a website using CloudFlare, you may receive an error 521. This error occurs because the origin web server refused the connection from CloudFlare.

  • You are using nginx in front of Apache

Error 521


CloudFlare IP addresses were blocked by nginx because of an outdated contents of /etc/nginx/conf.d/cloudflare.conf.

/etc/nginx/conf.d/cloudflare.conf contains CloudFlare servers IP addresses list.


  • Make sure that you're not blocking CloudFlare IPs in .htaccess, iptables, or your firewall.
  • Make sure that /etc/nginx/conf.d/cloudflare.conf is up to date and contains all IP addresses found here:
  • Make sure your provider isn't rate limiting or blocking IP requests from the CloudFlare IPs and ask them to whitelist the IP addresses found here:
  • Make sure that you're operating off of the most recent versions of Bad Behavior or mod_security. You want to ensure that mod_security's core rules aren't blocking CloudFlare requests.
  • 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.

Search Words

cloudflare error 521 web server down

error 521

742559b1631652fadd74764ae8be475e 56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 e335d9adf7edffca6a8af8039031a4c7 2a5151f57629129e26ff206d171fbb5f

Email subscription for changes to this article
Save as PDF