[英]Error installing Let's Encrypt on nginx server
我试图在四个站点上安装Let的加密SSL证书: mysite.com
es.mysite.com
fr.mysite.com
de.mysite.com
我运行了以下命令: certbot --nginx -d mysite.com -d www.mysite.com
,它适用于mysite.com,es.mysite.com,fr.mysite.com。 当我运行sudo certbot --nginx -d de.mysite.com
出现以下错误:
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: de.mysite.com
Type: unauthorized
Detail: Invalid response from
https://de.mysite.com/.well-known/acme-challenge/te29XBKAQdQBbQxvzPTgfgaFpzM_OUj6b4gSuiuPvOI
[MY IP ADDRESS]: "\r\n\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML
1.0 Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
然后,我尝试使用以下代码手动安装证书: certbot certonly --manual -d de.mysite.com
。 然后我被问到Are you ok with your IP being loggged?
我选择了Y然后按回车键。 然后我按照这一步:
Create a file containing just this data:
SJpIiQET8X0vehhTjmcPBrm3zsbS1p8f9Mf2oKE5l5w.SkXszSMjtmN2-3gN7kkDhgSElerR3H1MgUc9N8z70n4
And make it available on your web server at this URL:
http://de.mysite.com/.well-known/acme-challenge/SJpIiQET8X0vehhTjmcPBrm3zsbS1p8f9Mf2oKE5l5w
我按Enter继续,然后得到同样的错误:
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: de.mysite.com
Type: unauthorized
Detail: Invalid response from
https://de.mysite.com/.well-known/acme-challenge/SJpIiQET8X0vehhTjmcPBrm3zsbS1p8f9Mf2oKE5l5w
[MY IP ADDRESS]: "\r\n\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML
1.0 Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
任何人都可以建议如何解决此错误并成功安装Let的加密SSL证书?
谢谢。
我设法解决了我的问题。 我必须首先在我的nginx配置中包含以下内容:
location ~ /.well-known {
allow all;
}
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /data/wordpress/mysite/;
}
location = /.well-known/acme-challenge/ {
return 404;
}
然后我必须通过运行certbot certonly --manual -d de.mysite.com
手动安装Let的加密SSL证书,并按照步骤成功安装证书。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.