Skip to content

Instantly share code, notes, and snippets.

@4lun
Last active March 10, 2017 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4lun/1702eda65e0485750716f71270c09a4c to your computer and use it in GitHub Desktop.
Save 4lun/1702eda65e0485750716f71270c09a4c to your computer and use it in GitHub Desktop.
Generate and install SSL certificate with letsencrypt (for nginx)
export DOMAIN="mydomain.com"
curl https://get.acme.sh | sh
bash --login
mkdir -p /etc/nginx/certs/$DOMAIN/
acme.sh --issue -d $DOMAIN -w /var/www/$DOMAIN/public/
acme.sh --install-cert -d $DOMAIN \
--certpath /etc/nginx/certs/$DOMAIN/cert.pem \
--keypath /etc/nginx/certs/$DOMAIN/key.pem \
--fullchainpath /etc/nginx/certs/$DOMAIN/fullchain.pem \
--reloadcmd "nginx -s reload"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment