symfony php configuration

Igor Sysoev is at rambler-co.ru
Thu May 14 16:02:45 MSD 2009


On Thu, May 14, 2009 at 07:52:21AM -0400, shaktale wrote:

> Hi again,
> 
> If anyone is still interested, finally I have changed the following:
> 
> 
> location / {
>    # If the file exists as a static file serve it directly without
>    # running all the other rewite tests on it
>    if (-f $request_filename) {
>        expires max; 
>        break;
>    }
> 
>    if ($request_filename !~ "\.(js|htc|ico|gif|jpg|png|css)$") {
>        rewrite ^(.*) /index.php last;
>    }
> }
> 
> 
> 
> For:
> 
> 
> location / {
>     try_files $uri /index.php;
> 
>     expires max;
> }
> 
> 
> 
> AFAIK the block related to if ($uri ~ "^(.+\.php)(/.+)")  must to be set as such, because is related to symfony's url routing, ie:
> 
> mysite.com/debugger.php/myaction/show/33

location ~ ^(.+\.php)(.*)$ {
    fastcgi_split_path_info         ^(.+\.php)(.*)$;
    fastcgi_param  SCRIPT_FILENAME  /path/to/php$fastcgi_script_name;
    fastcgi_param  PATH_INFO        $fastcgi_path_info;


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list