Letsencrypt, nginx使用certbot申請https證書和部署

在python3環(huán)境安裝certbot:

pip3 install certbot certbot-nginx

在nginx正常運(yùn)行的情況下,以下自動(dòng)完成申請,需要替換 email@youremail.com , domain.com 以及 -d 后面的域名為自己的域名:

certbot --nginx --agree-tos --redirect \
        -m email@youremail.com --eff-email \
        --preferred-challenges http-01 \
        --cert-name domain.com \
        -d domain.com,xyz.domain.com,www.domain.com  -q

申請完成后,默認(rèn)分配文件到 /etc/letsencrypt 中,并且自動(dòng)修改 /etc/nginx/conf.d/ 中的nginx配置文件 。

以下幾個(gè)常用命令。
擴(kuò)展域名:

certbot  --nginx --agree-tos -w /etc/letsencrypt --expand  \
        -d taskimage.com,www.taskimage.com,advice.domain.com,image.domain.com

為nginx生成配置文件:

certbot --nginx  install --cert-path /etc/letsencrypt/live/domain.com/  \
             --key-path /etc/letsencrypt/live/domain.com/privkey.pem  \
             --fullchain-path /etc/letsencrypt/live/domain.com/fullchain.pem  \
             -d domain.com,advice.domain.com,image.domain.com

簡單申請新的證書:

certbot --nginx

會(huì)要求填寫一系列信息。

只申請證書,不修改配置:

  certbot --nginx certonly
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容