Forward http(s)?://www.domainname.tld to https://domainname.tld

This commit is contained in:
Kevin MacMartin 2018-03-18 23:41:01 -04:00
parent 7b8b75c427
commit cc3615ad8c

View file

@ -2,7 +2,16 @@
server {
listen 80;
server_name REPLACEME.TLD;
server_name REPLACEME.TLD www.REPLACEME.TLD;
return 301 https://REPLACEME.TLD$request_uri;
}
server {
listen 443 ssl;
server_name www.REPLACEME.TLD;
ssl_certificate /etc/letsencrypt/live/REPLACEME.TLD/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/REPLACEME.TLD/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/REPLACEME.TLD/fullchain.pem;
return 301 https://REPLACEME.TLD$request_uri;
}