docker - 多个域的 certbot webroot 仅返回一个证书
问题描述
我正在尝试使用certbot certonly --webroot
为多个域创建证书,但只获得了一个证书,我完成了本教程:link which works great for one domain。
所以我尝试对两个域(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
解决方案
推荐阅读
- spagobi - 是否可以在 SpagoBI Server 5.2 中编辑数据源数据
- java - 我正在尝试使用 servlet 检索 BLOB 数据(图像)并在 html 页面中显示
- javascript - 检查浏览器和语言
- python - 带有 ValueError 形状的 while_loop 必须为 0 级,但对于 'while/LoopCond' 为 2 级
- ios - 游戏开发菜单
- mysql - MySQL Union 未按预期工作
- javascript - 如何映射包含一组数据和一个日期的json数据?
- sql - SQL 使用 LIKE %?% 搜索多个列
- java - Java Calendar 定义一周中的日期和时间范围以进行比较
- vb.net - 带有 COM 控件的 VB.net prgram 在 Windows 7 但不是 10 上运行