Recipe === Install homebrew/services, this will be helpful, you'll see later. :D ```bash $ brew tap homebrew/services ``` Install dnsmasq because it's awesome, no really, so you can use `.dev` as your development domain, this is really helpful, you'll see later. :D ```bash # Install dnsmasq via homebrew $ brew install dnsmasq; # Add dnsmasq config $ cat << EOF > /usr/local/etc/dnsmasq.conf bind-interfaces keep-in-foreground no-resolv address=/dev/127.0.0.1 listen-address=127.0.0.1 EOF # Create an additional resolver $ sudo mkdir -p /etc/resolver/ && $(echo 'nameserver 127.0.0.1' | sudo tee -a '/etc/resolver/dev') # Install nginx with http2 module $ brew install nginx --with-http2 # You're done here for now, we'd want to use port:80 so run these # services as root $ sudo brew services start dnsmasq $ sudo brew services start nginx ``` Generate SSL Certificates and add it to OSX keychain. ```bash # Let's make this a script to make life a bit easier $ vi ssl-certificate.sh # Copy the script below: SSL_DIR="/usr/local/etc/nginx/ssl" ROOT_SSL_NAME="node.dev" ROOT_SSL_FQDN="node.dev" # Create Nginx SSL Dir if it does not exists. if [ ! -d $SSL_DIR ]; then sudo mkdir -p $SSL_DIR fi # Create your very own Root Certificate Authority sudo openssl genrsa \ -out "$SSL_DIR/$ROOT_SSL_NAME.key" \ 2048 # Self-sign your Root Certificate Authority # Since this is private, the details can be as bogus as you like sudo openssl req \ -x509 \ -new \ -sha256 \ -nodes \ -key "$SSL_DIR/$ROOT_SSL_NAME.key" \ -days 3652 \ -out "$SSL_DIR/$ROOT_SSL_NAME.crt" \ -subj "/C=EE/ST=Tallinn/L=FakeTaxi/O=ACME Signing Authority Inc/CN=${ROOT_SSL_FQDN}" # NOTE # -nodes means "no-des" which means "no passphrase" # -days 3652 means that this example will break about 10 years from now # Add this shit to OSX keychain sleep 1 sudo security add-trusted-cert \ -d \ -r trustRoot \ -k "/Library/Keychains/System.keychain" "$SSL_DIR/$ROOT_SSL_NAME.crt" ``` And you're all set. [Imgur](http://i.imgur.com/aENVATd.png)