Created
January 8, 2016 09:54
-
-
Save bjoern-r/0690afb5da8e791b88f1 to your computer and use it in GitHub Desktop.
refresh letsencrypt ssl certificates for nginx using docker
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 | |
set -e | |
docker pull quay.io/letsencrypt/letsencrypt:latest | |
docker rm -f letsencrypt || true | |
for DOMAIN in foobar.de aceme.com ; do | |
docker run --rm --name letsencrypt \ | |
-v "/data/nginx/static:/webroot" \ | |
-v "/etc/letsencrypt:/etc/letsencrypt" \ | |
-v "/var/lib/letsencrypt:/var/lib/letsencrypt" \ | |
quay.io/letsencrypt/letsencrypt:latest \ | |
auth -d $DOMAIN \ | |
--webroot --webroot-path /webroot \ | |
-m mail@foobar.com \ | |
--renew-by-default --agree-tos | |
done | |
echo "reloading nginx" | |
docker exec nginx /etc/init.d/nginx reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment