How can I configure nginx so the bare non www domain redirects to www after adding the site. Thanks!
to redirect all your non www domain to www, create this extra vhost in /etc/nginx/conf.d
server_name "~^(?!www\.).*" ;
return 301 $scheme://www.$host$request_uri;
I don't get this working... I'm using sll ... and it is always forwarded to https://domain.name instead of https://www.domain.name ... any futher hint?
Thanks for your advice
Hello meierj, you may have to edit the file /etc/nginx/conf.d/forcessl-yourdomain.tld.conf because it will redirect http traffic to https without www by default.
@meierj after updating an nginx conf file you need to do sudo service nginx reload and give it a minute or two
sudo service nginx reload
Hosted by VirtuBox