我已经在数字海洋上设置了我的服务器,并按照 https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
当我尝试运行该命令时:sudo certbot --nginx --debug-challenges -v -d example.com
我收到以下错误;
- The following errors were reported by the server:
Domain: example.com
Type: unauthorized
Detail: Invalid response from
http://example.com/.well-known/acme-challenge/kwKqSzEgrvV1PqYY9dBVPY4CTnwrxtaOmslOPqoTfEM:
"<!-- Server: P3PWPARKSTAT03 --><!DOCTYPE html><body
style=\"padding:0; margin:0;\"><html><head><meta name=\"viewport\"
content=\"widt"
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.
为了测试目的,我只使用一个名为 default 的服务器块
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name example.com;
location / {
try_files $uri $uri/ =404;
}
location ~ /.well-known/ {
allow all;
}
}
运行 certbot 时,在将质询行添加到服务器块后它会暂停,我可以通过加载文件来验证它们是否已成功添加:/etc/nginx/sites-available/default
并且一切都检查无误。如果我重新启动服务器并转到它检查的 URL,它会成功加载。但出于某种原因,当 certbot 进行质询时,我仍然会收到无效响应。
如果我在进行 certbot 检查之前(在挑战暂停期间)使用 curl,我会得到Wefk-bZlghLmz1UJBi337ScuwftpHKiza9sYhvsRCCg.-Rc1IAaUYmogSoOzgM-LhiqofLtcV63DTWuWifw2yqo
看起来正确的结果。
我是不是漏掉了什么或者忘记了什么?因为当我手动验证时,似乎一切都正常,但对于 certbot 却不行。顺便说一句,我将我的实际域名换成了 example.com。但实际上那里并没有我所拥有的。