將主域新增至 Lets Encrypt 以進行 nginx 配置

將主域新增至 Lets Encrypt 以進行 nginx 配置

我正在 EC2 實例上運行一個帶有 dockerized nginx 的應用程序,並使用 Let's Encrypt 配置我的 ssl。現在我想要該憑證的另一個主網域,但我沒有這樣做。當我跑步時

sudo docker run -it --rm -v /docker-volumes/etc/letsencrypt:/etc/letsencrypt -v /docker-volumes/var/lib/letsencrypt:/var/lib/letsencrypt -v /docker/letsencrypt-docker -nginx/src/LetsEncrypt/LetsEncrypt-site:/Data/LetsEnEncrypt -v“/docker-Volumes/var/Log/LetsEnEncrypt:/var/Log/LetsEnEncrypt” certbot/certbot certonly --webroot --agemail mail --agmail -tos --no-eff-email --webroot-path=/data/letsencrypt -d mydomain.de -d www.mydomain.de -d anotherdomain.com -d www.anotherdomain.com

它失敗。如果我在沒有它的情況下運行該命令,anotherdomain.com -d www.anotherdomain.com則會成功更新我的憑證。

我可以在 LetsEncrypt 中擴展主域的憑證還是僅適用於子網域?或者由於嚴格的 https,.dev 域可能有問題?或者我需要以某種方式改變我的 nginx 配置嗎?

我的配置:伺服器{

監聽 443 ssl;伺服器名稱 mydomain.de;字符集utf-8; ssl_stapling 關閉; ssl_stapling_verify 關閉;

ssl_certificate /etc/letsencrypt/live/mydomain.de/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/mydomain.de/privkey.pem;設定 $my_host $http_host; if ($http_host = "mydomain.de") { 設定 $my_host "mydomain.de"; }

location / {
    proxy_pass http://django:5000;
    proxy_set_header Host $my_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

}

伺服器 { 聽 80 ;伺服器名稱 mydomain.de;返回301https://mydomain.de$request_uri; } 伺服器 { 監聽 80 ;伺服器名稱 www.mydomain.de;返回301https://mydomain.de$request_uri; } 伺服器 { 監聽 443 ;伺服器名稱 www.mydomain.de;返回301https://mydomain.det$request_uri; ssl_stapling 關閉; ssl_stapling_verify 關閉;

    ssl_certificate  /etc/letsencrypt/live/ mydomain.de/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/ mydomain.de/privkey.pem;

}

非常感謝對此的任何幫助。預先非常感謝。

相關內容