关于nginx+php伪静态的问题

环境:phpstudy
nginx 1.15.11 + php5.6

URL重写规则:

location / {
if (-f $request_filename/index.html){
    rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
    rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
    rewrite (.*) /index.php;
}
}

现在有个BUG,正常的目录 /xinwenzixun/ /xinwenzixun/index.html /xinwenzixun/任意字符.html 都可以成功重写到index.php
但是唯独 /channel.php?id=2 这样的返回403,研究了半天不知道哪里出现问题了额

直接这样:

location /xinwenzixun {
      rewrite (.*) /index.php;
}
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632