Website doesn't open with WWW

I deployed a site on Cloudflare and its working fine. We are able to access it over https://domain.com

However, when I type only www.domain.com the site is not accessible at all. What might be wrong?

Always Use HTTPS: ON

Automatic HTTPS Rewrites: ON

What is the issue or error message you get when going to the WWW subdomain?

It just does not open. It keeps connecting and waiting for a response for the longest time.

And then throws up the error 522 as attached in the screenshot.

However, the origin server is UP and running.

Hello,

Anybody has a solution?

First thing I notice is that your server does not seem to have SSL configured. You still need a certificate on your server for a secure communication.

Hi Sandro,

We do not have SSL installed on this site at the server. Therefore, we use Flexible SSL option. But the https does come, except, it throws the error when we try prefixing it with WWW

Flexible should not be used, thats a bad choice. You need to install a certificate on your server as well.

Sure. Would you think that is the reason why https://domain.com works fine but www.domain.com throws an Error 522?

Not necessarily, but it definitely is a source of error as well.

Can anyone help?

Regards,
Pranab.

Did you fix the certificate?

Sandro,

I have 10 more sites on Cloudflare (which do not have SSL installed on their origin servers). But all of them resolve to https://domain.com (regardless of whether you type domain.com or www.domain.com on the address bar).

Clearly, there is some other issue with the Domain in question.

Not having a certificate on your server is a most insecure setup. I am afraid I couldnt be of assistance in this case.

Hi @pranab,

I suggest you read https://community.Cloudflare.com/t/why-flexible-ssl-mode-is-not-the-best-choice/63531 and fix your insecure setup.

You may then wish to https://community.Cloudflare.com/t/redirect-www-example-com-to-example-com/78347

Hi Domjh,

Thank you for the support. I just resolved this. It was a CNAME for WWW that was pointing to a wrong server. I should’ve looked at the basics before going so deep into analysis.

Resolved.