I myself just had to do the same. What you want to do is use some kind of reverse proxy.
I use here: https://github.com/nodejitsu/node-http-proxy
Just install the proxy package: npm install http-proxy
I have a proxy server running on a server on port 80. I set DNS in each domain to point to this server.
Each application runs on one server (im uses screens).
For example:
MySiteApplication1 - 3001 MySiteApplication2 - 3002 MySiteApplication3 - 3003
Then your proxy file will look like this
var httpProxy = require('http-proxy'); var server = httpProxy.createServer({ router: { 'mysite1.com': 'localhost:3001', 'mysite2.com': 'localhost:3002', 'mysite3.com': 'localhost:3003' } }); server.listen 80
Menztrual
source share