Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is my problem:

I have two subdomains:


These will be used for projects hosted at our office. The setup at the office is just one server ( with 2 VM's (Nginx ( & Apache ( ).

What I've done now:

  • Made sure that both subdomains are sent to our fixed IP-address.
  • From our firewall it gets sent to

What I want to be able to do:

  • has to interpret the address, and according to the settings I provide, it has to (again) redirect to the appropriate VM, where Nginx and Apache will redirect it to the correct folder (last part is no problem).

I'm running Debian Squeeze on every machine.

If it's not clear, please ask additional questions so I can be of more assistance with finding a proper solution.

share|improve this question
up vote 1 down vote accepted

You can achieve such setup by configuring your server ( as a reverse proxy (possible with nginx and apache) that proxy-passes requests to the right back-end server (Nginx ( & Apache ( )

On your reverse proxy, you need to configure 2 NameVirtualHosts ( &, on each vhost, you redirect the location "/" to the desired IP address

share|improve this answer
So I installed Nginx on now, with this conf: Would this be correct? – Strangler Oct 17 '12 at 15:09
Yes, this should do the job. – m0ntassar Oct 17 '12 at 15:31
It works! Thx for the help! – Strangler Oct 18 '12 at 6:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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