taco_dev
A command line tool to setup a local domain environment for development using nginx and dnsmasq.
Status: Not ready.
)
Requirements
dnsmasq- Dnsmasq provides network infrastructure for small networks: DNS, DHCP, router advertisement and network boot.nginx- HTTP and reverse proxy server.
If you are on Mac and has howebrew installed, simply run homebrew install dnsmasq nginx.
Usage
- Setup
dnsmasq
To verify:
)
- Setup
nginx
To tell nginx to proxy a request to port 80, we need to defined the upstream server. It can be either a local server running on a specific port localhost:8080 or a unix socket object unix:/tmp/example.test.
;
This will add a taco_dev.conf in nginx/servers directory.
upstream taco_dev.test {
server unix:/tmp/taco_dev;
}
server {
listen 80;
server_name taco_dev.test;
root /Users/fraserxu/projects/taco_dev;
try_files $uri/index.html $uri @taco_dev.test;
location @taco_dev.test {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://taco_dev.test;
}
}
- Reload nginx and :tada:
License
MIT