溫馨提示×

Nginx SSL在Debian如何更新

小樊
48
2025-05-12 18:57:17
欄目: 云計算

要在Debian上更新Nginx SSL證書,請按照以下步驟操作:

  1. 首先,確保已經安裝了Certbot。如果尚未安裝,請運行以下命令來安裝它:
sudo apt update
sudo apt install certbot python3-certbot-nginx
  1. 更新系統的軟件包列表:
sudo apt update
  1. 運行Certbot以更新SSL證書。Certbot會自動檢測到Nginx配置文件中的SSL證書,并提示您輸入電子郵件地址和同意更新證書。運行以下命令:
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

yourdomain.comwww.yourdomain.com替換為您的實際域名。

  1. Certbot將嘗試自動更新Nginx配置文件并重新加載Nginx服務。如果一切順利,您將看到類似于以下的輸出:
Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/yourdomain.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/yourdomain.com/privkey.pem
Your certbot Apache configuration file was successfully updated.
  1. 如果Certbot提示您手動重新加載Nginx服務,請運行以下命令:
sudo systemctl reload nginx

現在,您的Nginx SSL證書應該已經更新。請確保您的網站可以通過HTTPS正常訪問,并檢查證書是否已正確安裝。

0
亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女