My domain is not working. It is throwing 521 error. It was working earlier. Please tell me what’s the problem.And how can I fix it.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $200 of credit to try our products over 60 days!
I would assume you’re using some CDN service like CloudFlare. The 521 can occur when there is an issue with your web server, but this can be sometimes caused by the CDN provider as well.
Also if you’ve recently enabled the CDN and you’re using custom firewall rules, make sure to whitelist all the IP ranges of the CDN provider.
You can temporarily disable the CDN to test if the issue is within your server. You can check this article from. their community:
Are you using CloudFlare or another CDN? 521 error is a server error that occurs when the web server is down or unreachable. This error is typically caused by a connectivity issue between the web server and the Cloudflare CDN.
There are a few possible reasons why you may be seeing a 521 error:
The server is down or unreachable: If the web server is down or unreachable. Here you’ll need to SSH to your Droplet and check if everything is alright with services, usually Apache2/Nginx are the one causing this issue
Firewall or security settings: If the Droplet and Services is up and running, but the firewall or security settings are blocking requests from the Cloudflare CDN, you may see a 521 error. You can check your firewall or security settings to ensure that they are not blocking requests from Cloudflare.
Network connectivity issues: Network connectivity issues can also cause a 521 error. You can ping your Droplet and see if it’s working, if you can’t ping you can try to reboot it from the Control Panel and then Try to use the Recovery Console to enter it https://docs.digitalocean.com/products/droplets/how-to/recovery/recovery-console/