Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is my problem:

I have two subdomains:

  • foo.company.com
  • bar.company.com

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

What I've done now:

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

What I want to be able to do:

  • 10.10.10.9 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

1 Answer 1

up vote 1 down vote accepted

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

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

share|improve this answer
    
So I installed Nginx on 10.10.10.9 now, with this conf: pastebin.com/BwWLb1wf 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

 
discard

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.