Last active
November 6, 2016 07:31
-
-
Save qnub/ce475a5007db1d9b04d8 to your computer and use it in GitHub Desktop.
Script for auto renew Let's Encrypt serts
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
| location /.well-known/acme-challenge/ { | |
| root /var/run/acme/acme-challenge/; | |
| } |
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
| # nginx webroot for acme | |
| server { | |
| server_name *.example.com; | |
| root /var/run/acme/acme-challenge; | |
| include acme-challenge; | |
| location / { | |
| return 301 https://$host$request_uri; | |
| } | |
| } |
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
| #!/bin/bash | |
| # RUN AS ROOT! | |
| # sudo apt-get install letsencrypt | |
| EMAIL=user@example.com | |
| MAIN_DOMAIN=$1 | |
| SECOND_DOMAIN=$2 | |
| # certs will be placed under `/etc/letsencrypt/live/$MAIN_DOMAIN` directory | |
| letsencrypt certonly -m $EMAIL --webroot -w /var/run/acme/acme-challenge -d $MAIN_DOMAIN -d $SECOND_DOMAIN |
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
| #!/bin/bash | |
| # RUN AS ROOT! | |
| # sudo apt-get install letsencrypt | |
| # mkdir -p /var/run/acme/acme-challenge | |
| letsencrypt renew |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment