ubuntu - 无法使用 nginx (certbot) 向域添加让我们加密 ssl 证书

标签 ubuntu ssl nginx ubuntu-18.04 vps

我在使用 nginx 和 certbot 将 Let's Encrypt SSL 证书应用到我的域时遇到问题。我的(Nuxtjs)网站在 Ubuntu 18.04 的 VPS 上运行。我想将证书添加到 mydomain.nl 和 staging.mydomain.nl 但无法。我对此很陌生,但我之前确实设法做到了这一点,没有任何问题。
如果我是正确的,certbot 会在运行 sudo certbot --nginx 时尝试放置一个文件来验证域。 .但后来我收到以下错误:

Failed authorization procedure. mydomain.nl (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://mydomain.nl/.well-known/acme-challenge/PBjT0nQy7m5_bE42I1jr5mMaYxLMma4ONP9FAUgCD3c [2a02:2268:ffff:ffff::4]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p"
IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: mydomain.nl
   Type:   unauthorized
   Detail: Invalid response from
   http://mydomain.nl/.well-known/acme-challenge/PBjT0nQy7m5_bE42I1jr5mMaYxLMma4ONP9FAUgCD3c
   [2a02:2268:ffff:ffff::4]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD
   HTML 2.0//EN\">\n<html><head>\n<title>404 Not
   Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p"

   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.
我也尝试在配置中添加这个 block :
location ~ /.well-know/acme-challenge {
    allow all;
    root /var/www/mydomain.nl/html;
}
但没有成功。我可以在我的域上访问我的网站,因此 DNS 应该是正确的。

最佳答案

您的域注册商已为您的域预先配置了 AAAA 记录。从您的 DNS 设置中删除 AAAA 记录。在您的情况下,删除“www.mydomain.nl AAAA 2a02:2268:ffff:ffff::4”记录。

aaaa-record-example

关于ubuntu - 无法使用 nginx (certbot) 向域添加让我们加密 ssl 证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61768411/

相关文章:

java - 如何从代码动态地为 Java RMI 设置 SSL?

nginx - Cgit 和 Nginx URL 重写

Nginx 忽略位置指令?

nginx - 使用uwsgi协议(protocol)将uWSGI连接到NGinx有什么好处?

java - 如何添加新的 SSL 连接 Spring Boot jks cacerts

php - 无法在公司防火墙后面使用 Composer 进行更新/安装

windows - 自动 Samba 共享脚本

ubuntu - 带有ubuntu的Windows虚拟机无法启动

docker - 远程容器-Ubuntu :Latest -/dev/null: Permission denied

ubuntu - SaltStack - 版本未更改时如何重新安装软件包