北京网帮你
thinkphp 5 在phpstudy nginx 环境下路由无法生效(报404 错误 )
时间:2018-05-05 14:03:21 浏览:189



nginx自动生成的

1 server {
2        listen       80;
3        server_name  www.yunyuecrm.com yunyuecrm.com;
4        root   "E:/phpStudy/WWW/yunyuecrm/public";
5        location / {
6            index  index.html index.htm index.php;
7            #autoindex  on;
8        }
9        location ~ \.php(.*)${content}nbsp;{
10            fastcgi_pass   127.0.0.1:9000;
11            fastcgi_index  index.php;
12            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
13            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
14            fastcgi_param  PATH_INFO  $fastcgi_path_info;
15            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
16            include        fastcgi_params;
17        }
18 }
自要加上这个就可以了

  if (!-e $request_filename) {    
               rewrite ^(.*)$ /index.php?s=$1 last;    
               break;    
           }



1 server {
2        listen       80;
3        server_name  www.yunyuecrms.com yunyuecrm.com;
4        root   "E:/phpStudy/WWW/yunyuecrm/public";
5        location / {
6            index  index.html index.htm index.php;
7            #autoindex  on;
8      if (!-e $request_filename) {    
9                rewrite ^(.*)${content}nbsp;/index.php?s=$1 last;    
10                break;    
11            }
12        }
13        location ~ \.php(.*)${content}nbsp;{
14            fastcgi_pass   127.0.0.1:9000;
15            fastcgi_index  index.php;
16            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
17            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
18            fastcgi_param  PATH_INFO  $fastcgi_path_info;
19            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
20            include        fastcgi_params;
21        }
22 }


[上一篇] PHP给源代码加密的三种方法
[下一篇]Mysql如何让表的主键从0开始、主
Copyright 2022 © 93580.com.cn 网帮你

2022 © 版权所有 红花岗区网帮你信息技术工作室

工信部备案号:黔ICP备2024036985号-2

请使用网帮你微信扫码登录