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