Error 521 Cloudflare with HTTPS while HTTP works

cloudflaredns-hostinghttphttpsweb-hosting

I am experienced issues when it comes to loading using HTTPS:// using CloudFlare.

The issue is that it gives me a code ERROR 521 web server is down or it took to long to respond. I have double checked to make sure to see if there is any errors haven't spotted any.

The website works perfectly over HTTP://. Here is my configuration.

Namecheap is the domain registrar, hostinger is the web host.

DNS config

Any reason why is this happening? My hosting is not a VPS.

Best Answer

One problem I can see is you've put all of the web host name servers into CloudFlare as A records, as well as the web server. This will result in your web requests being sent to the name servers, which will ignore the requests.

Start by removing all the A records from CloudFlare other than your web server IP, which is 31.170.167.145. This might solve your problem if you have intermittent access, but if you can never access the server on https then it won't.

As to the rest of your problem, you haven't given enough information to solve it. "It gives 521 error" - what gives the error? CloudFlare? How have you configured CloudFlare http - flexible, full, etc? What web server are you running? Can you access the web server via https directly?

Related Topic