nginx LetsEncrypt

linux

certbot https://certbot.eff.org/

windows

letsencrypt-win-simple.V1.9.3(个人认为比新版本好用)https://github.com/PKISharp/win-acme/releases/download/v1.9.3/letsencrypt-win-simple.V1.9.3.zip

执行letsencrypt.exe

之后选择M手工方式生成证书和密钥文件

输入域名example.com

输入web root所在目录Enter a site path (the web root of the host for http authentication:x: ginxhtml

成功生成后手工修改nginx配置,在对应server配置项下加入证书密钥配置

listen 443 ssl http2;
ssl_certificate C:\Users\Administrator\AppData\Roaming\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org\example.com-chain.pem;
ssl_certificate_key C:\Users\Administrator\AppData\Roaming\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org\example.com-key.pem;

最后加入定时任务,完成

 

原文地址:https://www.cnblogs.com/xiayudashan/p/9583452.html