Created
August 10, 2019 18:45
-
-
Save jas0ncn/1ea9a9873c1eb4c1bc3899b0d8ae55f0 to your computer and use it in GitHub Desktop.
Obtain A Let's Encrypt Cert using acme.sh and deploy with nginx-proxy in 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
# Apply ALIYUN DNS API TOKEN: https://ak-console.aliyun.com/#/accesskey | |
export Ali_Key="" | |
export Ali_Secret="" | |
# issue cert | |
~/.acme.sh/acme.sh --issue \ | |
--dns dns_ali \ | |
-d abc.com \ | |
-d "*.abc.com" | |
# install cert | |
~/.acme.sh/acme.sh --installcert \ | |
-d abc.com \ | |
--key-file /data/certs/abc.com.key \ | |
--fullchain-file /data/certs/abc.com.crt \ | |
--reloadcmd "bash /data/sh/restart-nginx.sh" | |
# content of /data/sh/restart-nginx.sh | |
docker ps | awk '$2 == "jwilder/nginx-proxy:latest" { system("docker restart " $1) }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment