hiddenist / node-hostname-proxy

Runs a master node process to redirect hostnames to the correct node process port using http-proxy. Think something like Apache virtual hosts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node Hostname Proxy

Runs a master node process to redirect hostnames to the correct node process port using http-proxy. Think something like Apache virtual hosts.

Requirements

  • Node.js version 0.5.0
  • http-proxy version 0.7.6

Running

All you need to do is run app.js as root. Most simply, like so:

sudo node app.js

Configuration

The data is populated from the config.js file, which expects a "hostnames" object with keys as the hostname, and data as the port. The config file can also provide a "redirects" object to define which hostnames should redirect other hostnames (for example, www to non-www).

See the config.sample.js file for a concrete example of the config file.

About

Runs a master node process to redirect hostnames to the correct node process port using http-proxy. Think something like Apache virtual hosts.


Languages

Language:JavaScript 100.0%