Search code examples
ubuntunginxdnswebserver

Redirect to HTTPS www - Nginx


I have a site

www.boring.com

I need to make sure that these 3 cases :

will to redirect to

I'm using Nginx in Laravel 5 on Ubuntu hosted on Digital Ocean.


This is what I set in Digital Ocean

enter image description here


Result

RIght now, only one seem to work

http://www.boring.com

redirect to

https://www.boring.com


These 2 are not

http://boring.com

ERR_NAME_NOT_RESOLVED

https://boring.com

DNS_PROBE_FINISHED_NXDOMAIN

Did I do anything wrong on Digital Occean ?

Where can I fix this ?


Solution

  • You are using CloudFlare. So all SSL and subdomain redirections related not only to your server (Nginx) configuration but also to CloudFlare settings.

    All you need to do is to check out whether your domain name is listed in CloudFlare's DNS settings (see DNS tab). "www" subdomain is listed there, but the direct domain name was missing.