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

@ -1,18 +1,27 @@
# LARAVEL CONFIGURATION
server {
listen 80;
server_name REPLACEME.TLD;
return 301 https://REPLACEME.TLD$request_uri;
listen 80;
server_name REPLACEME.TLD www.REPLACEME.TLD;
return 301 https://REPLACEME.TLD$request_uri;
}
server {
listen 443 ssl;
server_name REPLACEME.TLD;
root /srv/http/REPLACEME.TLD/public;
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;
}
ssl_certificate /etc/letsencrypt/live/REPLACEME.TLD/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/REPLACEME.TLD/privkey.pem;
server {
listen 443 ssl;
server_name REPLACEME.TLD;
root /srv/http/REPLACEME.TLD/public;
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;
ssl_session_timeout 1d;