Skip to content

Redirect to HTTPS is not working only for specific URL

Daisho Komiyama edited this page Jan 17, 2022 · 1 revision

Hi,

I host two sites, one is quebec3.com and the other is daishodesign.com. Both have been set up with SSL encryption using Let's Encrypt.

However, the one with daishodesign.com doesn't work; both HTTP and HTTPS are available. I don't want users to access any insecure URL so I set up an Nginx config file (/etc/nginx/site-available/...) properly. It should redirect users from HTTP to HTTPS, but it doesn't. The exact same configuration applies to quebec3.com and it perfectly works for it somehow.

I've been searching for a solution for about a few weeks, but I didn't find any until today. Today, I stopped googling with the keyword "Nginx", instead, I started including "Cloudflare" which hosts the domain name. Then I found something.

Always Use HTTP

The page tells there's a configuration about HTTPS on Cloudflare. And I opened the page for daishodesign.com, and I found the root cause finally.

Always Use HTTPS

Always Use HTTPS was OFF!! Whereas it was ON for quebec3.com. This is it! I was totally biased my Nginx configuration was doing it wrong, but it was not! Cloudflare has some control over it, and I totally missed that.

So TIL; Check your domain registerer when it comes to redirecting as well as Nginx configuration.

Clone this wiki locally