跳到主要内容

https证书

acme.sh

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

source ~/.bashrz

域名指向服务器
启动nginx

acme.sh --issue -d mydomain.com --nginx

证书保存完成

方法2 指定根目录
/usr/share/nginx/html 为nginx默认目录

acme.sh --issue -d mydomain.com -d www.mydomain.com --webroot /usr/share/nginx/html

证书保存完成


Your cert is in: /root/.acme.sh/sing.arick.top_ecc/sing.arick.top.cer

ssl_certificate /root/.acme.sh/sing.arick.top_ecc/sing.arick.top.cer;
ssl_certificate_key /root/.acme.sh/sing.arick.top_ecc/sing.arick.top.key;