gpt4 book ai didi

Django 和 Certbot - 未经授权的无效响应 (HTTPS)

转载 作者:行者123 更新时间:2023-12-04 16:40:46 26 4
gpt4 key购买 nike

我正在尝试使用 Nginx 配置 Certbot (Letsencrypt)。

我收到此错误:

 - The following errors were reported by the server:

Domain: koomancomputing.com
Type: unauthorized
Detail: Invalid response from
http://koomancomputing.com/.well-known/acme-challenge/xvDuo8MqaKvUhdDMjE3FFbnP1fqbp9R66ah5_uLdaZk
[2600:3c03::f03c:92ff:fefb:794b]: "<html>\r\n<head><title>404 Not
Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404
Not Found</h1></center>\r\n<hr><center>"

Domain: www.koomancomputing.com
Type: unauthorized
Detail: Invalid response from
http://www.koomancomputing.com/.well-known/acme-challenge/T8GQaufb9qhKIRAva-_3IPfdu6qsDeN5wQPafS0mKNA
[2600:3c03::f03c:92ff:fefb:794b]: "<html>\r\n<head><title>404 Not
Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404
Not Found</h1></center>\r\n<hr><center>"

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.
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.

在/etc/nginx/sites-available/koomancomputing 中:
server {
listen 80;
server_name koomancomputing.com www.koomancomputing.com;

location = /favicon.ico { access_log off; log_not_found off; }
location /staticfiles/ {
root /home/kwaku/koomancomputing;
}

location /media/ {
root /home/kwaku/koomancomputing;
}

location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
}

我的 DNS A/AAAA 记录:

enter image description here

我不知道该怎么做,所以我进行了搜索并找到了 django-letsencrypt 应用程序,但我不知道如何使用:
enter image description here

最佳答案

您的域有正确的 AAAA记录通过 IPv6 配置到您的服务器,certbot 选择它来验证您的服务器。
但是,您在 nginx 下配置的服务器块只为您的域监听 IPv4 上的端口 80。当 certbot 请求 Let's Encrypt 访问您的质询并颁发证书时,nginx 未配置为正确响应 IPv6 上的质询。在这种情况下,它通常会返回其他内容(例如在您的情况下是 404,或默认站点)。
您可以通过修改前两行以监听服务器的所有 IPv6 地址来解决此问题:

server {
listen 80;
listen [::]:80;

# other configuration
}
编辑完成后,重启nginx并再次运行certbot。

关于Django 和 Certbot - 未经授权的无效响应 (HTTPS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61324327/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com