I currently have a web server running apache with multiple sites on it using virtual hosts. I want to add a service to my server that is using nodejs but I want it to be accessible under the same domain as a sub-domain. This is, I believe, impossible with my current setup since nodejs and apache can't both listen on port 80 simultaneously, so I suppose I must run some proxy service on port 80 and then split my requests between the two servers based on the Host
request header.
I have a few questions regarding this matter:
- Are my above assumptions correct?
- Is such a proxy setup costly in terms of performance?
- What would be the best suited software to serve as the proxy? Is it best to stick with a server implementation (such as apache or nginx) for the proxy software or would a simple tcp server script perform better since it would be designed especially for this matter?