522 Connection Timeout Error

Hi all,

I have just switched to Cloudflare for my website but I am receiving a 522 error and cannot access my website. I can use nslookup to check both my root domain and the site name and both return a Cloudflare address. I have added the A record to the DNS section of my Cloudflare dashboard. I can also ping my website address as well as traceroute to it with no issues. I am not sure if it matters but I am also in the process of transferring to Cloudflare as my registrar. If there is any other information I need to provide please let me know as this is my first post. Thanks for all the ideas and help in advance.

Sometimes the host’s firewall blocks Cloudflare from connecting to your server. Here’s some information:

Thanks for the link, I have read over it and checked those items. Neither my router or my host server are blocking any Cloudflare IPs.

Without the domain it could be just a little tad difficult to say anything :wink:

Though one thing could be clarified, do you have a valid HTTPS certificate on your server?

Thanks for the response my domain name is nnclj.tech. I do have a valid SSL cert for my server.

Right now there is no 522 but a redirection loop. Is your SSL mode “Full strict”? If not, set to it and try again.

It was set to Flexible but I went ahead and changed it to Full Strict. This is the screen I get when trying to get to my site.

Your screenshot does not match the “nnclj.tech” hostname you told us. I’m getting a “DNS points to prohibited IP” error for that one.

My apologies if I did not share the right information. The root of my domain is nnclj.tech, I realize what you are saying as the screen shot is for my website not the root of my domain so I apologize for that. I am also receiving the prohibited IP error as well. I will check where the root of my domain is resolving to make sure that is correct and I will respond back. Thanks for the help so far I appreciate it.

1 Like

Assuming your server’s IP address ends in 124 it would appear there simply is not web server running on your machine. It is pingable but does not react to either HTTP or HTTPS.

1 Like

Since I said the wrong thing earlier can you be more specific. My public IP that my web server is behind does not end in 124. If I do a dig to my root domain it currently does not resolve. I think the issue maybe where Cloudflare is looking for the root domain. The website address does still resolve to Cloudflare.

Edit: Of course as soon as I post that it starts responding.

1 Like

Well, it earlier resolved to such an IP address, hence the question.

Right now you dont have a “www” record (which however is by no means necessary) and your naked domain throws a Cloudflare error because of a misconfigured DNS record for it. Where is it currently pointing to?

Sandro thanks for the reply. I have been looking into this and I think I understand better what you are asking me. You where correct the .124 is the IP where the root of my domain (nnclj.tech) resolved, this is different the the IP where my web server lives. I added two record in manually when I switched to Cloudflare one was the A record that pointed directly to the IP where my web server lives. The second record was the root domain A record which I added because one did not show up when I added my site to Cloudflare. I think this where my mistake was, I thought that record would be needed to allow things to work properly and maybe it is not truly needed. If I remove that record and do a dig to nnclj.tech it returns the two Cloudflare names servers I was assigned if I do nslookup I do not get an answer. If I try and go to my site I still get the same 522 error. I thought these issues where connected but maybe I am wrong. I think overall I thought I understood how all this worked but its clear that I missed something so I apologize for new person questions or responses.

Just make sure the server is accessible from the Internet and (if you want HTTPS) has a valid certificate and you should be fine.

1 Like

Thanks again for all the help, I removed the A record for the root and let everything update and it brought my site online.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.