location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
nginx 隐藏index.php
最新推荐文章于 2025-10-26 00:30:00 发布
博客展示了一段Nginx配置代码,在location /块中,通过if判断请求文件是否存在,若不存在则使用rewrite指令将请求重写为/index.php?s=$1 ,并以last标记结束处理。
500

被折叠的 条评论
为什么被折叠?



