I follow Railscast http://railscasts.com/episodes/293-nginx-unicorn?view=asciicast about creating Nginx and Unicorn on Vagrant with one important difference. Ryan makes his application with Rails 3 (which has default / public / index.html, which Rails 4 only generates dynamically). After installing and starting Nginx, we were able to see the default page on port 8080. Then we created a basic configuration file for Nginx to be placed in the rails application configuration directory
/config/nginx.conf
server { listen 80 default;
and then deleted the default page on sites included and tied to the configuration file
vagrant@lucid32 :/etc/nginx/sites-enabled$ sudo rm default vagrant@lucid32 :/etc/nginx/sites-enabled$ sudo ln -s /vagrant/config/nginx.conf todo
After that, Ryan restarted nginx and was able to see the Rails index page on localhost: 8080. However, when I visit localhost: 8080, I get 403 Forbidden error.
403 Forbidden nginx/1.1.19
Update
since Rails 4 no longer has a public / index.html file, I think the 403 error could be caused by this, as I found out from this blog post at http://www.nginxtips.com/403-forbidden-nginx/ . He says that to automatically set autoindex to on (disabled by default) in the config, but I'm not sure how to set it to show the Rails main page.
When i did it
server { listen 80 default; root /vagrant/public; location / { autoindex on; } }
he got rid of 403 permission errors (yay!), however he does not show the default Rails homepage. Rather, it shows the directory structure, so I wonder what the correct way to install it. 
If I try to set it to location / public, I will get error 403. again. Any ideas?
location /public { autoindex on; }
Update
Since I use Vagrant (virtual box), the application is in / vagrant, however setting the location to location / vagrant also leads to 403 error
location /vagrant { autoindex on; }