Skip to content

Instantly share code, notes, and snippets.

@jas0ncn
Created August 10, 2019 18:45
Show Gist options
  • Save jas0ncn/1ea9a9873c1eb4c1bc3899b0d8ae55f0 to your computer and use it in GitHub Desktop.
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
# 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