我有一个 ads.txt 的别名,但是当我访问 /ads.txt 并查看 error.log 时,会出现此错误:
[error] 20051#20051: *457 "/root/public/front/public/ads.txt/index.html" is not found (20: Not a directory), client: 172.70.55.104, server: server.com, request: "GET /ads.txt/ HTTP/2.0", host: "server.com"
obs:我为这个问题更改了 server.com 的 URL。
这是我的别名代码:
location /ads.txt { alias /root/public/front/public/ads.txt; }
我曾尝试更改权限,因为在发生该错误之前我遇到了问题。
尝试:
location /ads.txt {
root /root/public/front/public/;
}