Redirecting non-www to www and HTTP to HTTPS.

Posted October 14, 2016 5.7k views
NginxNode.jsLet's EncryptUbuntu 16.04

This is the www. link using https

However, when I type it does not redirect to the www., but to the HTTPS only;

Does someone know what to do?

Thank you!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

remove existing one that you set for HTTP to HTTPS and try adding the following line after
listen 80;

rewrite ^/(.*)$1 permanent;