服务器上放了xx.txt文件,访问的时候却报404

314 阅读1分钟

在nginx配置文件中添加以下配置即可(robots.txt为例)

location /robots.txt {
    root  /www/wwwroot/xxx/根目录/;
}