我正在尝试在运行于
https
上的网页上设置 Django 1.8
。我在这个领域非常陌生,所以我使用 Certbot。我按照说明进行操作,直到./path/to/certbot-auto certonly
。
您希望如何通过 ACME CA 进行身份验证?
- 1:将文件放入webroot目录(webroot)
- 2:启动临时网络服务器(独立)
我选择了1。
然后它想要我的域名,下一步是:
选择 salix.sk 的 webroot:
>>> /home/django/salix
返回错误
等待验证...清理挑战失败 授权程序。 salix.sk (http-01): urn:acme:error:unauthorized :: 客户端缺乏足够的 授权 :: 无效响应 http://salix.sk/.well-known/acme-challenge/some_code: ”
页不”重要提示: - 服务器报告了以下错误:
域名:salix.sk 类型:未经授权 详细信息:无效 来自
的回应 http://salix.sk/.well-known/acme-challenge/some_code: ” 页不”要修复这些错误,请确保您的域名是
正确输入该域的 DNS A 记录
包含正确的 IP 地址。
我认为我应该以某种方式在我的项目中设置路径,但不知道如何设置。它在我的项目根目录中创建了一个文件夹
.well-known
,里面没有任何可见文件。
你知道该怎么做吗?
编辑: 我已经更改了
etc/nginx/sites-available/default
添加到服务器部分:
location ~ /.well-known {
allow all;
}
所以:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
# Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
#location /RequestDenied {
# proxy_pass http://127.0.0.1:8080;
#}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /usr/share/nginx/html;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
# fastcgi_index index.php;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
location ~ /.well-known {
allow all;
}
}
这也没有帮助。
删除 IPv6 地址的 AAAA 记录 - 为我修复
可以使用root用户运行
在nginx.conf中设置代码
用户root root;
尝试:
apt更新,apt升级
将时区和日期/时间更改为实际值
删除 IPv6 地址的 AAAA 记录