Last active
August 9, 2016 14:09
-
-
Save return1/d5ba9e25459aeb82949ee415d87c4c67 to your computer and use it in GitHub Desktop.
Letsencrypt Certbot New Certificate for Nginx
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
# from https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04 | |
# add to nginx server config | |
location ~ /.well-known { | |
root /usr/share/nginx/html; | |
allow all; | |
} | |
ssl_certificate_key /etc/letsencrypt/live/www.domain.com/privkey.pem; | |
ssl_certificate /etc/letsencrypt/live/www.domain.co/fullchain.pem; | |
ssl_trusted_certificate /etc/letsencrypt/live/www.domain.co/fullchain.pem; # certificate for OCSP stapling | |
# request certificate | |
./certbot-auto certonly -a webroot --webroot-path=/usr/share/nginx/html -d domain.com -d www.domain.com | |
# test renew | |
./certbot-auto renew --dry-run | |
# renew | |
./certbot-auto renew --post-hook "service nginx reload" | |
# add cronjob | |
# add logrotate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment