Fix error Error 521: Web server is down
Error 521 or Error 521: Web server is down occurs because the original web server refused to connect from Cloudflare. More specifically, Cloudflare tried to connect to your original server on port 80 or 443 but received a connection error that was rejected.
Error 521 or Error 521: Web server is down occurs because the original web server refuses to connect from Cloudflare (Cloudflare is a reverse proxy service provider, is an intermediate proxy server between a server and clients) . More specifically, Cloudflare tried to connect to your original server on port 80 or 443 but received a connection error that was rejected.
Fix error Error 521: Web server is down
- Common causes of error 521
- Web server is offline
- Request from Cloudflare is blocked
- Troubleshoot Error 521: Web server is down
- Experiment with cURL
- Experiment with Telnet
Common causes of error 521
The two most common causes of error 521 are:
Web server is offline
The original web server process (eg Apache or Nginx) may not run or has failed. In that case:
- Make sure your web server is running normally.
- Review the server error log to find the cause of the error.
If you are unable to perform these tasks, contact the host provider.
Request from Cloudflare is blocked
The original web server or hosting provider network may be blocking requests from Cloudflare.
As a reverse proxy, Cloudflare connects to your server from a Cloudflare IP and all subsequent traffic to the exclusive from a smaller group of Cloudflare IPs. As a result, certain server-side security solutions can distort the increase in legitimate connections from this smaller IP group, and treat this as an attack. This results in some IP Cloudflare being blocked or restricted by speed.
To resolve this issue, whitelist all Cloudflare IP strips in the server firewall or any other original security software. List of IP ranges of Cloudflare:
IPv4
- 103.21.244.0/22
- 103.22.200.0/22
- 103.31.4.0/22
- 104.16.0.0/12
- 108.162.192.0/18
- 131.0.72.0/22
- 141,101,64.0/18
- 162.158.0.0/15
- 172.64.0.0/13
- 173.245.48.0/20
- 188,114.96.0/20
- 190.93.240.0/20
- 197.234.240.0/22
- 198.41.128.0/17
IPv6
- 2400: cb00 :: / 32
- 2405: b500 :: / 32
- 2606: 4700 :: / 32
- 2803: f800 :: / 32
- 2c0f: f248 :: / 32
- 2a06: 98c0 :: / 29
If you cannot whitelist the Cloudflare IP, contact your hosting provider.
Troubleshoot Error 521: Web server is down
You can use third-party tools such as cURL or Telnet to check the server's response.
For the following example commands, you need to replace the IP address 1.2.3.4 with the original server's IP address. Alternatively, you can run these tests on port 443.
Experiment with cURL
cURL allows you to simulate an HTTP request, so it is a good tool to check if your original server is working properly. You can run cURL through the Terminal command line tool on Mac OS or Linux.
Run the cURL command for your server IP with A or CNAME record for the domain displayed in the DNS application of the Cloudflare dashboard page.
curl http://1.2.3.4 -v
If successful, you will see an HTTP 200 response along with the site's HTML. The unsuccessful cURL request will look like this:
# curl 1.2.3.4
curl: (7) Failed to connect to 1.2.3.4 port 80: Connection refused
Experiment with Telnet
Windows users can check the connection using Telnet (via Command Prompt).
Run a command similar to the following:
telnet 1.2.3.4 80
Error, such as:
Unable to connect to remote host: Connection refused
means your web server is not running or blocking requests.
The connection error rejected will look like this:
# telnet 1.2.3.4 80 Trying 1.2.3.4. telnet: connect to address 1.2.3.4: Connection refused telnet: Unable to connect to remote host
See more:
- Quick fix "This site can't be reached" error on Chrome browser
- Quick fix error 107 net :: ERR_SSL_PROTOCOL_ERROR: SSL protocol error on Chrome browser
- Steps to fix "Your Preferences can not be read" in Chrome browser
You should read it
- How to fix VPN error 619
- How to fix A20 Error when starting the computer
- How to fix 'This App Can't Run on Your PC' error on Windows 10
- How to fix 403 Forbidden Error
- Summary of iOS 17 errors and how to fix them
- How to fix 502 bad gateway error
- Troubleshooting Error 1016 - Origin DNS error
- Fixed a bug with 'Error getting player information from the server' error when playing Pokemon GO
- How to fix the 404 Not Found error
- Instructions for fixing 502 Bad Gateway error
- How to fix 0xC000021A error on Windows
- The Bluestack error connecting to the server failed, this is how to fix it
Maybe you are interested
How to create a camera system for 2D games in Godot How to implement the health and damage system in Godot How to create a jumping mechanism in Godot How to create 2D effects in Godot with AnimatedSprite Drawing Objects and Shapes in Pygame Microsoft adds Windows 10 HDR support to Photoshop, Lightroom