Yaf框架路由访问路径无效

我在虚拟机上搭建了一个LNMP环境,基于php的yaf框架写了个小demo。nginx的配置文件如下所示:
server {
listen 8050;
server_name www.myblog.com;
root /usr/share/nginx/www.myblog.com/public/;
index index.php index.html index.htm;

location ~ .+\.php($|/) {
    root /usr/share/nginx/www.myblog.com/public/;
    fastcgi_pass 127.0.0.1:8051;
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

location ~.*\.(js|csss)?$
{
    root /usr/share/nginx/www.myblog.com/application/views/;
}

}
目前,如果直接访问域名,能访问到默认的index路径下的控制器内容。但controllers文件夹下的其他php文件,无法通过“域名/文件路径”的方式访问。求各位大神帮忙看看原因。。。多谢。。。

端口怎么写的不一样。是不是端口的问题

看看你的$document_root的设置是否和你的php的文件能对应上

server {
listen 80;
server_name www.yaf.com;
location / {
index index.php index.html index.phtml index.htm;
root "F:\Php\Project\yaf";
** if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last; break;
}**
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ .php(.*)$ {
root "F:\Php\Project\yaf";
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}

这是我的配置,你参考一下

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

这一段是错误的,
应该是这样的:
rewrite ^/(.*)$ /index.php/$1 last;
找过很多配置,一字之差,结果完全不一样