Just saw this on Err.the_blog. A very useful trick for any Nginx user.
The nginx_config_generator is a gem which takes a YAML file of options for Nginx vhosts and spits out a complete Nginx-friendly config file.
$ generate_nginx_config ‐‐example > config.yml
This’ll create an example config file for you. Yep, YAML. It looks just like this.
Here’s the link to the original article titled Nginx config like whoa.