Forward http(s)?://www.domainname.tld to https://domainname.tld
This commit is contained in:
parent
7b8b75c427
commit
cc3615ad8c
1 changed files with 17 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue