nginx 404 not found Path URL style

Hello,

I have been following this link to configure nginx

http://www.yiiframework.com/doc/cookbook/15/

This is how my config looks like

    location ~ \.php$ {


        fastcgi_pass   127.0.0.1:9000;


        fastcgi_index  index.php;


        include        fastcgi_params;


        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;


        fastcgi_param PATH_INFO $fastcgi_script_name;


    }

I can open http://localhost/dtruck/

but anything after that i see this error in the log file.

2010/02/09 02:41:59 [error] 7325#0: *1 open() "/data/inetpub/www/dtruck/index.php/site/login" failed (20: Not a directory), client: 127.0.0.1, server: localhost, request: "GET /dtruck/index.php/site/login HTTP/1.1", host: "localhost", referrer: "http://localhost/dtruck/index.php"

Can somebody please help me, what i have missed ? I dont want to hide the index.php for now.

Arvind

Hello,

I think I found the solution to have this working

"myapplication/index.php/controller/action "

location ~ ^(.+\.php)(.*)$ {

        fastcgi_split_path_info ^(.+\.php)(.*)$;


        fastcgi_pass   127.0.0.1:9000;


        fastcgi_index  index.php;


        include        fastcgi_params;


        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;


        fastcgi_param  PATH_INFO $fastcgi_script_name;


    }

But one thing to remember is that , displaying index.php is probably getting outdated and not a clean url style. Most places index.php is being hidden and that is also the way to go.

then in that case, we dont need that complex RegExp

~ ^(.+\.php)(.*)$

fastcgi_split_path_info ^(.+\.php)(.*)$;

and we can use this to hide the index.php

location /myapplication {

     try_files $uri /myapplication/index.php;


    }

thanks

Arvind