I have a project I've been working on to automate the setup of a rails server on Amazon EC2. There are bash scripts to set up Nginx with/without SSL and sample config files for unicorn. Everything is tested with Rails 4.
Take a look at the /projects, /unicorn, and /nginx folders for related stuff.
I am working on improving the documentation, but there are comments in the setup_*.sh scripts that explain a lot. I've not tested it on Ubuntu (only Amazon Linux instances, which are redhat based) but you should be able at least get some good info there.
--Ivan