mkdir -p /usr/local/etc/nginx/sites-available
File locations:
nginx.conf
to/usr/local/etc/nginx/
default
anddefault-ssl
to/usr/local/etc/nginx/sites-available
#STOP APACHE
sudo apachectl stop
#REPLACE PORTS
sudo sed -i 's/8080/80g' /usr/local/etc/nginx/nginx.conf
mkdir -p /usr/local/etc/nginx/sites-available
wget https://gist.githubusercontent.com/kmassada/1ad1b0e1742139b8f3d5/raw/47763109f40a44a1baf43926c709bff83e9cee94/default -O /usr/local/etc/nginx/sites-available/default
wget https://gist.githubusercontent.com/kmassada/1ad1b0e1742139b8f3d5/raw/47763109f40a44a1baf43926c709bff83e9cee94/default-ssl -O /usr/local/etc/nginx/sites-available/default-ssl
sudo nginx
#SETUP PROJECTS
mkdir ~/Sites
sudo mkdir -p /var/ && sudo ln -s ~/Sites /var/www
SITE="test.com"
mkdir -p ~/Sites/$SITE
echo '<html><body><h2>'${SITE}'</h2></body></html>' >> ~/Sites/$SITE/index.html
yes|cp -f /usr/local/etc/nginx/sites-available/default /usr/local/etc/nginx/servers/$SITE
sed -i "s/localhost/$SITE.build/g" /usr/local/etc/nginx/servers/$SITE
sed -i "s/root_path/\/var\/www\/$SITE/g" /usr/local/etc/nginx/servers/$SITE
sudo nginx -s reload