title: Rails nginx directory index is forbidden
body: <p>Hello i setup my first webserver for rails but when i copy rails app and run nginx server, im getting 403 error in browser and error.log says that directory index is forbidden.. the error is solved when i create index.html in public folder in rails app but why rails is not started ? (server was compilled with passenger) and bundle install inside rails app works. thank you.</p>
  
  <p><strong>/opt/nginx/conf/nginx.conf</strong></p>
  
  <pre><code>http {
      passenger_root /home/lukas/.rvm/gems/ruby-1.9.3-p448@rails3/gems/passenger-4.0.14;
      passenger_ruby /home/lukas/.rvm/wrappers/ruby-1.9.3-p448@rails3/ruby;
      include /opt/nginx/conf.d/*.conf; 
  ...
  }
  </code></pre>
  
  <p><strong>/opt/nginx/conf.d/default.conf</strong></p>
  
  <pre><code>server {
   listen *:80;
   server_name hostname.org www.hostname.org
  
   passenger_enabled on;
   rails_env production;
   root /var/www/default/public;
  
   error_log /opt/nginx/logs/vhosts/default/error.log;
   access_log /opt/nginx/logs/vhosts/default/access.log combined;
  }
  </code></pre>
  
  <p><strong>folder permissions</strong></p>
  
  <pre><code>lukas@webserver:/var/www$ ls -al
  drwxrwxr-x 13 lukas lukas 4096 Aug 30 12:26 default
  </code></pre>
  
  <p>im <strong>starting nginx</strong> with</p>
  
  <pre><code>sudo /etc/nginx/sbin/nginx
  </code></pre>
  
  <p><strong>/opt/nginx/logs/vhosts/default/error.log</strong></p>
  
  <pre><code>2013/08/30 12:48:08 [error] 32643#0: *1 directory index of "/var/www/default/public/" is forbidden, client: xx.xx.xx.xx, server: ...
  </code></pre>