Я пытаюсь использовать certbot certonly --webroot
для создания сертификата для нескольких доменов, но получил только один сертификат, я прошел этот урок: ссылка , которая прекрасно работает для одного домена.
поэтому я попытался сделать то же самое для двух доменов (sub.domain.com domain.com) nginx conf:
server {
listen 80;
listen [::]:80;
server_name domain.com www.domain.com;
location / {
proxy_pass http://api:80;
}
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
}
server {
listen 80;
listen [::]:80;
server_name sub.domain.com www.sub.domain.com;
location / {
proxy_pass http://api:80;
}
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
}
затем я использовал эту команду внутри контейнера certbot:
command: certonly --force-renewal --webroot --webroot-path=/var/www/html -d domain.com -d sub.domain.com --email some.email@gmail.com --agree-tos --no-eff-email --staging
это работает, но я получил только один сертификат (sub.domain.com).
certbot | Saving debug log to /var/log/letsencrypt/letsencrypt.log
certbot | Plugins selected: Authenticator webroot, Installer None
certbot | Renewing an existing certificate
certbot | IMPORTANT NOTES:
certbot | - Congratulations! Your certificate and chain have been saved at:
certbot | /etc/letsencrypt/live/sub.domain.com/fullchain.pem
certbot | Your key file has been saved at:
certbot | /etc/letsencrypt/live/sub.domain.com/privkey.pem
certbot | Your cert will expire on 2020-06-09. To obtain a new or tweaked
certbot | version of this certificate in the future, simply run certbot
certbot | again. To non-interactively renew *all* of your certificates, run
certbot | "certbot renew"
certbot exited with code 0