Using apt-get/dnf/pkg_add/ports/rpm/pacman/whatever...
# /etc/dnsmasq.d/dev
# Have dnsmasq resolv *.dev domains to localhost
address=/dev/127.0.0.1
# /etc/nginx/sites-available/dev.conf
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name "~^(?<app>\w+)\.dev";
location ~ / {
proxy_pass http://unix:/tmp/$app.sock;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}
}
`sudo ln -s /etc/nginx/sites-available/dev.conf /etc/nginx/sites-enabled/`
sudo service dnsmasq restart
sudo nginx -t && nginx -s reload
Heres is an example using puma to start a rack application: puma -b unix:///tmp/my_app.sock
.
Any way of starting a web application that makes it listen on a socket should do fine.
...now get back to coding :)