ACME.SH基于NGINX申请证书

下载安装

1
curl https://get.acme.sh | sh -s email=my@example.com

or

1
wget -O -  https://get.acme.sh | sh -s email=my@example.com

设置别名

1
alias acme.sh=~/.acme.sh/acme.sh

查看帮助

1
acme.sh -h

设置软链

1
ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/nginx

申请证书

1
acme.sh --issue -d example.com --nginx /usr/local/nginx/conf/conf.d/example.com

安装证书

1
2
3
4
acme.sh --install-cert -d example.com \
--key-file /path/to/keyfile/in/nginx/key.pem \
--fullchain-file /path/to/fullchain/nginx/cert.pem \
--reloadcmd "service nginx force-reload"