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

My question is pretty much identical to the question listed but they did not get an answer as they ended up using Linux as the reverse proxy.

I need to have IIS the main site and linux (Apache) being the proxied site(s).

so I have (IIS7) (Linux Apache)

they have subdomains of

I want all traffic to go to and to say anything that is should be proxied to linux box on internal network, (believe ARR can do this but not sure how).

I can not have it running as Apache doing the proxying as I need IIS exposed directly.

any and all advice would be great.


I think this might help me:

<rule name="Canonical Host Name" stopProcessing="true">    
    <match url="(.*)" />    
        <add input="{HTTP_HOST}" negate="true" pattern="^cto\.com$" />  
        <add input="{HTTP_HOST}" negate="true" pattern="^antoniochagoury\.com$" />   
        <add input="{HTTP_HOST}" negate="true" pattern="www.antoniochagoury\.com$" />   
    <action type="Redirect" url="{R:1}" redirectType="Permanent" />    


I will have a look at this when I have access to the IIS7 box.


share|improve this question
Why exactly do you need IIS "exposed directly"? – John Gardeniers May 18 '10 at 12:17
I will be using WCF and a number of other services and I do not want these all going through a proxy before they are handled by IIS. Previously had some issues with webservices when they went through an Apache proxy. The linux box just runs some old php and static content (mainly) and will have no problem being proxied. Windows was a bit more "fussy". – Jon May 18 '10 at 12:30
I think it might be possible if I can proxy on the host value – Jon May 18 '10 at 15:17
Have not been able to get it to work. I setup an IIS site for each website and used rewrite rules. It forwarded it to the other server but seemed to mess with the header so that Apache didn't know which site to serve up. – Jon May 18 '10 at 21:29
I don't understand why you're proxying anything. Why don't you burn another public IP from your subnet and statically assign that or NAT (port forward) to your Linux box and change the DNS accordingly? – gravyface Jul 22 '13 at 2:23

I swear this has been answered several times already.

You need to add two pieces of software to IIS to use it as a reverse proxy: URL rewrite and application request routing (ARR). Both can be downloaded from the IIS web site.

The documentation to get you started can be found there.

share|improve this answer

Your edit mentions it, that HTTP_HOST is the server variable for the domain name. You have a couple options. If the Apache server is publicly exposed, you can use a redirect like you have there.

You need a back reference to the URL so that are unique bindings per site.

For example, add a 4th condition, and make sure that it's at the bottom:

(that means -anything- -dot- -anything(but a dot)- -dot- -anything(but a dot)-)

Now {C:1} will be a back reference to your 2nd level domain, without the TLD. i.e. site1, site1.

In your action, you can use something like this:

Then you can create bindings in Apache for,, etc.

The other option is to setup ARR and use a reverse proxy rather than a redirect. That retains the original URL and your Apache server doesn't need a public URL or IP. Your rewrite rules can be similar so that each URL hits a different site on the Apache server.

share|improve this answer
Hi, the Apache machine is not publicly visible. I have been having issues with subdomains with the rewrite. I need to investigate further before I fully reply with that here. Thx – Jon May 19 '10 at 14:44
In that case ARR is the way to go. Use similar URL Rewrite rules but use ARR to proxy the requests. – Scott Forsyth - MVP May 19 '10 at 15:54

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.