我也遇到了。问题是访问这种URL http://xxx.com/admin.php/index/index,会直接404, 只要是xxx.php/index/index就是404,还没去到PHP那边,如果使用上面的方式修改,就可以正常访问了。
- location ~ \.php(.*)$ {
- try_files $uri =404;
- fastcgi_pass 127.0.0.1:20073;
- fastcgi_index index.php;
- #fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
- #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- #fastcgi_param PATH_INFO $fastcgi_path_info;
- #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-
- set $fastcgi_script_name2 $fastcgi_script_name;
- if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") {
- set $fastcgi_script_name2 $1;
- set $path_info $2;
- }
- fastcgi_param PATH_INFO $path_info;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name2;
- fastcgi_param SCRIPT_NAME $fastcgi_script_name2;
-
- include fastcgi_params;
- }
复制代码 |