Created
September 27, 2019 10:46
-
-
Save demidovsky/f783609bf12a552bdfbb78f2badf52f7 to your computer and use it in GitHub Desktop.
nginx + certbot (letsencrypt) config example
This file contains hidden or 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
| #/etc/nginx/sites-enabled/default | |
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| server_name _; | |
| return 301 https://$host$request_uri; | |
| } | |
| server { | |
| listen 443 ssl; | |
| listen [::]:443 ssl ipv6only=on; | |
| server_name EXAMPLE.COM; | |
| root /var/www/html; | |
| index index.html index.htm index.nginx-debian.html; | |
| location / { | |
| try_files $uri $uri/ =404; | |
| } | |
| ssl_certificate /etc/letsencrypt/live/EXAMPLE.COM/fullchain.pem; | |
| ssl_certificate_key /etc/letsencrypt/live/EXAMPLE.COM/privkey.pem; | |
| include /etc/letsencrypt/options-ssl-nginx.conf; | |
| ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment