Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Here's my setup:

Windows Server (2003) receives all traffic for *, which (up to now) redirects all incoming port 80 traffic to a Linux VM (using VMWare virtual network manager).

I now need to setup another website on this server, using IIS6, to handle

How do I separate the HTTP traffic as such: -> IIS
  everything else (*,, raw IP) -> Linux VM

I thought of setting up an Apache server on Windows as Reverse Proxy. But can ProxyPass handle hostnames? (all examples I see handle directories).

Is there another/easier solution? Would lighttpd help?

TIA for your help.

[FWIW: Changing the architecture is not an option. Else I wouldn't ask ;-). An acceptable option if it helps (I doubt though) is to setup a 2nd public IP)]

share|improve this question

You can set up VirtualHosts in Apache, and then use ProxyPass for the to reverse proxy into IIS, and have a default VirtualHost that reverse proxies into your Linux VM.

You'd want a configuration that was something like this:

<Virtualhost *:80>


    # Reverse proxy into IIS
    ProxyRequests off
    ProxyPass / http://ip.of.IIS.machine/
    ProxyPassReverse / http://ip.of.IIS.machine/

<VirtualHost _default_:80>
    ProxyRequests off
    ProxyPass / http://ip.of.linux.machine/
    ProxyPassReverse / http://ip.of.linux.machine/        

Those configs are missing most of the configuration, but the important bits are that the first VirtualHost definition matches on, and this then does a reverse proxy into the IIS machine. The second definition matches everything else, and reverse proxies into the linux machine.

Note, I haven't tested the above as it is written, but I have definitely got an apache setup with multiple virtualhosts where one vritualhost is a reverse proxy into another machine, so the basic theory is fine.

share|improve this answer
Daniel, thanks! It works. Oddly though, I had to put a ServerName in the default vhost or everything would go to the other one. The only problem is that IIS (localhost, different port) thinks the client is localhost hence, in case of application error, returns a detailed explanation of the error :-( – Serge Wautier Mar 25 '11 at 10:00
Glad it worked for you. Also, setting up a second public IP probably does help - you should (assuming windows does sane things here, I don't know) be able to bind IIS to one of the IPs, and serve it directly, and then forward everything on port 80 on the other IP through to your linux VM, and no apache+reverseproxy needed. – Daniel Lawson Mar 26 '11 at 2:11

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.