<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Dave Dash</title>
 <link href="http://davedash.com/tag/server/atom.xml" rel="self"/>
 <link href="http://davedash.com/tag/server"/>
 <updated>2012-04-07T22:42:44-07:00</updated>
 <id>http://davedash.com/</id>
 <author>
   <name>Dave Dash</name>
   <email>dd+atom1@davedash.com</email>
 </author>

 
 <entry>
   <title>nginx and symfony</title>
   <link href="http://davedash.com/2008/01/20/nginx-and-symfony/"/>
   <updated>2008-01-20T00:00:00-08:00</updated>
   <id>http://davedash.com/2008/01/20/nginx-and-symfony</id>
   <content type="html">&lt;p&gt;[tags]nginx, server, symfony[/tags]&lt;/p&gt;

&lt;p&gt;I almost gave up on nginx and was going to settle on lighttpd or Apache, but I decided to check the symfony list and in minutes Kiril Angov (Kupokomapa) answered with a working nginx configuration.  This is why I like the symfony community :)&lt;/p&gt;

&lt;p&gt;Here's what works (Note: This requires a running FastCGI server):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;server {
  listen       80;
  server_name  mysite.com *;
  root /var/www/mysite.com/web;
  index  index.php;

  charset utf-8;

  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 !~ &quot;\.(js|htc|ico|gif|jpg|png|css)$&quot;) {
      rewrite ^(.*) /index.php last;
    }
  }

  location ~ \.php($|/) {
    set  $script     $uri;
    set  $path_info  &quot;&quot;;

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

    fastcgi_pass   127.0.0.1:9000;

    include /etc/nginx/fastcgi_params;

    fastcgi_param  SCRIPT_FILENAME  /var/www/mysite.com/web$script;
    fastcgi_param  PATH_INFO        $path_info;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This works in my Ubuntu instance of nginx.  Other customziations to this might need to occur, but it's fairly solid so far.&lt;/p&gt;
</content>
 </entry>
 

</feed>

