title: nginx configuration. Yii project in separate directory [not in root]
body: <p>I spent over 6 hours on this trouble.</p>
  
  <p>I have nginx/1.2.7 server, and php-fpm on 127.0.0.1:9000.
  I have base nginx config: </p>
  
  <pre><code>server
  {
      listen 80;
      server_name example.org www.example.org;
  
      index index.php index.html;
  
      access_log /srv/www/example.org/logs/access.log;
      error_log /srv/www/example.org/logs/error.log;
  
      location /
      {
          root /var/www/html/example.org/public_html;
          try_files $uri $uri/ /index.php;
  
          location ~ \.php$
          {
              fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
              fastcgi_param PATH_INFO $fastcgi_script_name;
              fastcgi_pass 127.0.0.1:9000;
              fastcgi_index index.php;
              include fastcgi_params;
          }
      }
  </code></pre>
  
  <p>And it works fine! All php files work like they must.</p>
  
  <p>But I have some separate yii-project, which need to execute in other than main root folder.
  And I have this configuration added at bottom:</p>
  
  <p>Where <strong><strong>/srv/www/example.org/yiitest</strong></strong> — it is a root of yiitest project (with 'protected' folder and other inside it).</p>
  
  <pre><code>location /yiitest
      {
          root /srv/www/example.org/yiitest;
          try_files $uri $uri/ /index.php?$args;
  
          location ~ \.php$
          {
              fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
              fastcgi_param PATH_INFO $fastcgi_script_name;
              fastcgi_pass 127.0.0.1:9000;
              fastcgi_index index.php;
              include fastcgi_params;
          }
      }
  </code></pre>
  
  <p>But it doesn't work. I've got 'File not found'.
  And maximum what I can get, it is: example.org/yiitest/ the main page works fine.
  And if I go to example.org/yiitest/site/contact/ I'll get file not found. :(</p>
  
  <p>I can't understand, how to correctly setup yii-project in separate subdirectory of a server.</p>