错误日志每天都好多,最多的就是访问目录和文件地址错误,日志文件越来越大,过几天就得清理一次,不知道其他人的xiuno站点是不是也是这样的问题,这次想解决一下。
发现的在错误日志中总是显示以下错误
2024/01/14 21:44:41 [error] 1316#0: *3358 open() "index.php/hostloc/m/me/upload/attach/202005/1_CUZSBHAUZDA7Q8C.jpeg" failed (20: Not a directory), client: 60.188.11.29, server: m.shee.cc, request: "GET /index.php/hostloc/m/me/upload/attach/202005/1_CUZSBHAUZDA7Q8C.jpeg HTTP/1.1", host: "m.shee.cc", referrer: "
这些路径都是错的,怀疑可能是伪静态问题,之前一直使用这个伪静态规则
location ~* \.(htm)$ {
rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last;
}
修改后的规则
location ~* \.(htm)$ {
if (!-e $request_filename) {
rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last;
}
}
现在还没有看到错误,应该是解决了。
其他
下面是在网上找到另一个xiuno伪静态规则,可能在虚拟主机上会用到。
location / {
rewrite "^(.*)/(.+?).htm$" $1/index.php?$2.htm last;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
}
index index.html index.htm index.php;
root /data/wwwroot/xiuno.com;
}