Skip to content

Instantly share code, notes, and snippets.

@wangzuo
Created December 20, 2016 04:39
Show Gist options
  • Save wangzuo/dd4bd06719aebbbb8c888669cfe999de to your computer and use it in GitHub Desktop.
Save wangzuo/dd4bd06719aebbbb8c888669cfe999de to your computer and use it in GitHub Desktop.
local_development_setup

brew

  • brew install dnsmasq
  • brew install nginx

dnsmasq

# /usr/local/etc/dnsmasq.conf
no-dhcp-interface=
server=8.8.8.8
addn-hosts=/usr/local/etc/dnsmasq.hosts

# /usr/local/etc/dnsmasq.hosts
10.181.1.114 athena.huaxing.com

nginx

/usr/local/etc/nginx/certs/
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /usr/local/etc/nginx/certs/athena.huaxing.com.key -out /usr/local/etc/nginx/certs/athena.huaxing.com.crt
(FQDN: athena.huaxing.com)

/usr/local/etc/nginx/nginx.conf
server {
    listen 80 default;
    listen       443 ssl;

    server_name  athena.huaxing.com;

    ssl_certificate       /usr/local/etc/nginx/certs/athena.huaxing.com.crt;
    ssl_certificate_key   /usr/local/etc/nginx/certs/athena.huaxing.com.key;

    ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers         HIGH:!aNULL:!MD5;


    location / {
      proxy_pass   http://127.0.0.1:2000;
    }
}

dig athena.huaxing.com @127.0.0.1 -> 10.181.1.114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment