Nginx for Symfony

Denis F. Latypoff denis at gostats.ru
Sat May 24 18:43:25 MSD 2008


Hello Aleksandar,

Saturday, May 24, 2008, 9:18:20 PM, you wrote:

> Hi,

> On Sam 24.05.2008 20:51, John Huong wrote:
>> I would like to seek assistance with configuring nginx for a symfony
>> project.

> [snipp]

>> Also how do I tell nginx to always load all references to the sf
>> folder (e.g. /var/www/myproject/web/sf) to the symfony data folder?

> I have this working setup:

> ###
> server {
> .
> .
> .
>          location / {
-            root   /home/httpd/virtserver/<DOMAIN>/html;

-            if ($request_filename !~ "\.(js|htc|ico|gif|jpg|png|css|htm)$") {
>              rewrite ^(.*) /index.php last;
-            }
-            index  index.html index.htm;
>          }

+          location ~ \.(js|htc|ico|gif|jpg|png|css|html?)$ {
+            root   /home/httpd/virtserver/<DOMAIN>/html;
+            index  index.html index.htm;
           }

>          location /sf/ {
>            root /home/php/lib/php/data/symfony/web;
>          }

>          location ~ \.php($|/) {

>            set  $script     $uri;
>            set  $path_info  "";

>            if ($uri ~ "^(.+\.php)(/.+)") {
>              set  $script     $1;
>              set  $path_info  $2;
>            }

>            include        fastcgi_params;

>            fastcgi_index  index.php;

>            fastcgi_param  SCRIPT_FILENAME 
> /home/php/projects/symfony/web$script;
>            fastcgi_param  PATH_INFO        $path_info;

>            fastcgi_pass   127.0.0.1:8085;
>          }
>       }
> ###

> Hth

> Aleks



-- 
Best regards,
 Denis                            mailto:denis at gostats.ru






More information about the nginx mailing list