There are few things to add to the title.

Suppose we have a domain foo.com and a domain bar.com and we want the first to be served by apache and the second to be served by nginx (both running on the same machine, please consider the possibility to use also other web servers, like lighthttpd), and we want them to be accessible just writing the URL and without specifying any port (at least on client side, but a redirect on server side would be acceptable).

Is that possible? How to accomplish something like that? I don't know where to start and googling I can only find how to host multiple domain on the same server... that is not what I'm looking for.


It is possible with a few different approaches.

1. Different IP-addresses

Point foo.com and bar.com to different IP-addresses on the same machine, and make each web server bind to one IP-address each.

2. Run a proxy

Run both domains as virtualhosts in one webserver, and then let e.g. bar.com get proxied back to the other web server.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.