当前位置: 代码迷 >> 综合 >> phpstudy【nginx】无法加载控制器:Index
  详细解决方案

phpstudy【nginx】无法加载控制器:Index

热度:53   发布时间:2023-12-15 06:21:26.0

 在使用nginx访问项目时会出现如下情况:

在加上index.php时访问效果如下:

由此可见是因为重写的原因,在配置文件中加入如下代码:

location / {index  index.html index.htm index.php;#autoindex  on;#添加部分if (!-e $request_filename) {          rewrite  ^(.*)$  /index.php?s=$1  last;            }   }

 

 重启phpstudy,再用原来的链接访问就ok了

  相关解决方案