Cloudflare Error 521: Web server is down
Hello,
When I visit my site I am getting the following error:
Error 521: Web server is down
2 Replies
Hello,
The error you are seeing is a result of Cloudflare not being able to make a connection to your server. Cloudflare has an awesome guide on resolving this issue.
This error typically comes up for two common reasons:
- Offlined origin web server application
- Blocked Cloudflare requests
To investigate scenario one, you'll want to ping your server's IP address to ensure it can be reached across the network. If so, you'll know you're server is currently up and running:
ping -qc 5 $LinodeIPaddress
Next you'll want to ensure your web app is functioning properly and connecting through HTTPS. This delves into some troubleshooting for scenario 2.
- curl your domain with verbose output and look for
HTTP/1.1 200 OK
and a connection over port 443:
curl -v $yourDomain
- If you're not connecting over port 443 (HTTPS) run a scan of your port to double check it's open/active. If it comes up as closed or filtered, that could be part of the issue as it means you don't currently have an SSL/TLS certificate configured:
nmap -Pn -p 443 --reason $yourIPaddress
- Should you fail to get an HTTP/1.1 200 response, you'll also want to double check the error logs for your web application to see what may be going awry: https://www.linode.com/community/questions/295/how-do-i-check-my-servers-log-files
If you find that your web app isn't to blame, this leaves us with the second possibility, which is that Cloudflare requests are being blocked for some reason. My recommendation here would be to take a look at Cloudflare's documentation, as they provide a list of possible resolutions when it comes to 521 errors: