Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -e
dir=$(cd ${1:-.} && pwd)
if [ $? -ne 0 ] || [ ! -d "$dir" ] || [ ! -w "$dir" ]; then
echo "$dir can not writable directory, abort."
exit 1
fi
server {
listen 8080;
server_name example.dev www.example.dev;
location / {
root /Users/Cobby/Sites/Example;
if ($host = 'www.example.dev' ) {
rewrite ^/(.*)$ http://example.dev:8080/$1 permanent;
}