这是我第一次构建服务器并将其托管到 AWS EC2。运行命令
sudo certbot certonly --standalone
或 sudo certbot certonly --webroot
时,我在下面收到此错误
Certbot failed to authenticate some domains (authenticator: standalone). The Certificate Authority reported these problems:
Domain: matthieuxroger.com
Type: unauthorized
Detail: Invalid response from http://matthieuxroger.com/.well-known/acme-challenge/nWRAFCcRUeVxZ0C5YtRg_9bihG2YQeqacUcGjxdCMzg [18.205.22.32]: "<!DOCTYPE html>\n<html>\n <head>\n <title>Matthieux Roger</title>\n <link rel='stylesheet' href='/stylesheets/style.css' />\n "
我在 AWS EC2 上运行的 ubuntu 20 上使用 nodejs。任何帮助将不胜感激。
在 Certbot 中使用
webroot
方法时,会启动一个 Web 服务器来提供单个文件,这样 Let's Encrypt 就可以验证域中服务器的所有权。但是当 LE 访问您的域时,它得到了一个提供 404 页面的不同服务器。您的域的 DNS 似乎未指向请求证书的 EC2 实例。 (或者它可能已经更新但尚未传播)。您需要更新 DNS 记录以指向使用 certbot 请求证书的服务器。或者,您可以使用不需要运行服务器来证明所有权的不同挑战类型(例如dns-01
)。
检查你域名注册中的域名服务器是否只有A记录指向你的地址,删除其他A记录