
而看到的都是404报错,但是Apache下是好的。

是不是nginx的设置有问题?附上各位大虾帮忙看看
location ~ .*\.php {
root /data/www/public;
# try_files $uri =404;
fastcgi_intercept_errors on;
fastcgi_index index.php;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_NAME $real_script_name;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php-fpm;
}
location / { #这段里的内容写不写效果都一样
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 break;
break;
}
}
最佳答案
