fideloper/Vaprobash — pull request #282 by Ilyes512 (2014-04-25 20:31:08+00:00)
Title: [WIP] Nginx create block

Based on this [script](https://gist.github.com/fideloper/9063376/) I continued the work done. I have tested it with 12.04, but will have to test it with 14.04 (that has been merged in today. Happy to see ZSH go BTW :P).

`sudo NGXCB -d /vagrant/laravel/public -s laravel.192.168.22.10.xip.io -n laravel -a` ( = Nginx Create Block ):
```
NGXCB:
Create a new Nginx Server Block (Ubuntu Server).
Assumes /etc/nginx/sites-available and /etc/nginx/sites-enabled setup used.

-e Enable the Server Block right away with NGXEN - i.e -e (without any value)
-d DocumentRoot - i.e. -d /var/www/yoursite
-h Help - Show this menu.
-n The Server Block Config name - default: vagrant - i.e. -n /etc/nginx/sites-available/vagrant
-s ServerName - i.e. -s example.com or -s sub.example.com
```

This for example `sudo NGXCB -d /vagrant/laravel/public -s laravel.192.168.22.10.xip.io -n laravel -a` will do the fallowing:
1. Create the folder `/vagrant/laravel/public`.
2. Make the above folder accessible trough `http://laravel.192.168.22.10.xip.io` in the browser.
3. Name the Server Block as `laravel` wish means it will be found in `/etc/nginx/sites-available/laravel`.
4. Enable the Server Block by sym linking `laravel` to `/etc/nginx/sites-enabled/laravel` using ngxen wish will also reload Nginx.

Well, test it out! Let me know what you think and what should be added/removed.