【发布时间】:2018-11-09 04:36:38
【问题描述】:
我正在尝试验证 SSL 证书的文件上传。
文件必须是.well-known/acme-challenge/file
我已经成功地放置了上面的文件,但是当从 web http://weburl.com/.well-known/acme-challenge/file 访问同一个文件时,出现了 404 错误。
当我将相同的文件放在.well-known/ 中时,该文件可以从路径http://weburl.com/.well-known/file 成功访问。
我的 nginx 配置:
server {
listen 80;
server_name weburl.com;
root /var/www/html;
location ~ /.well-known {
allow all;
}
location ~ /\.well-known/acme-challenge/ {
allow all;
root /var/www/html;
try_files $uri =404;
break;
}
}
【问题讨论】:
-
一个可能的解决方案是使目录可写,如:Solving known-acme-challenge unauthorized 404 error
标签: nginx lets-encrypt