Routing to various node.js servers on same machine

Posted by Dtang on Server Fault See other posts from Server Fault or by Dtang
Published on 2010-12-03T06:08:19Z Indexed on 2011/03/08 8:12 UTC
Read the original article Hit count: 341

Filed under:
|

I'd like to set up multiple node.js servers on the same machine (but listening on different ports) for different projects (so I can pull any down to edit code without affecting the others). However I want to be able to access these web apps from a browser without typing in the port number, and instead map different urls to different ports: e.g. 45.23.12.01/app -> 45.23.12.01:8001.

I've considered using node-http-proxy for this, but it doesn't yet support SSL. My hunch is that nginx might be the most suitable. I've never set up nginx before - what configuration do I need to do? The examples of config files I've seen only deal with subdomains, which I don't have.

Alternatively, is there a better (stable, hassle-free) way of hosting multiple apps under the same IP address?

© Server Fault or respective owner

Related posts about nginx

Related posts about node.js