我尝试在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:错误:未经授权::客户端缺乏足够的 authorization ::来自的响应无效 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;
}
}
哪个也没有帮助。
答案 0 :(得分:-1)
试试:
apt 更新,apt 升级
将时区和日期/时间更改为实际
删除 IPv6 地址的 AAAA 记录