Last active
April 2, 2016 14:44
-
-
Save raphendyr/0ad013881eaf6debb230 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
# m h dom mon dow command | |
# call renew weekly | |
57 0 */7 * * root /etc/letsencrypt/update.sh |
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
rsa-key-size = 4096 | |
email = root@mainhost.com | |
text = True | |
authenticator = webroot | |
webroot-path = /etc/letsencrypt/httpd_webroot |
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
#!/bin/sh -e | |
root="/opt/letsencrypt" | |
app="$root/letsencrypt-auto" | |
VENV_PATH="$root/venv/" | |
appc="$VENV_PATH/bin/letsencrypt" | |
args="--config /etc/letsencrypt/cli.ini" | |
export VENV_PATH | |
# if there is parameters, exec the letsencrypt app with those | |
if [ "x$1" != "x" ]; then | |
exec $app $args "$@" | |
# else, do the renew cycle | |
else | |
# renew certs | |
$app renew | |
# reload nginx if everting is ok | |
systemctl reload nginx | |
fi | |
# to add new cert to the pool for renewing, run: | |
# ./update.sh certonly -d my.custom.domain | |
# remember to make sure web server is redirecting /.well-known/ to /etc/letsencrypt/httpd_webroot/.well-known/, | |
# or add -w /web/root/path/ to above command |
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
location /.well-known { | |
alias /etc/letsencrypt/httpd_webroot/.well-known; | |
} |
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 { | |
listen 80; | |
server_name mainhost.com; | |
underscores_in_headers on; | |
root /var/www/mainhost.com; | |
include sites-conf/letsencrypt.conf; | |
# redirect to https | |
location / { return 302 https://$server_name$request_uri; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment