首先修改nginx配置

server {
        listen 80;
        server_name {域名};

        location /.well-known/acme-challenge {
                root {网站目录};
        }
}

接着输入如下命令

certbot certonly --webroot -w {网站目录} -q -n --agree-tos --no-eff-email -m {通知邮箱} -d {域名}
// -q 安静模式
// -n 非交互模式
// --agree-tos 同意协议
// --no-eff-email 不发送广告

证书将保存在 /etc/letsencrypt/live/{域名}/live

标签: 技术分享

添加新评论