Created
March 6, 2018 07:45
-
-
Save anonymous/43a072589a9c41fc76924cd9e3397789 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
root /var/www/html/example.com/; | |
server_name example.com www.example.com; | |
location ~* \.(jpg|jpeg|png|gif|ico|css|js|ttf|woff|pdf)$ { | |
expires 365d; | |
} | |
# managed by Certbot | |
listen 443 ssl http2; # managed by Certbot | |
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot | |
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot | |
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | |
} | |
server { | |
if ($host = www.example.com) { | |
return 301 https://$host$request_uri; | |
} # managed by Certbot | |
if ($host = example.com) { | |
return 301 https://$host$request_uri; | |
} # managed by Certbot | |
server_name example.com www.example.com; | |
listen 80; | |
return 404; # managed by Certbot | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment