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.

I'm setting up a server at home to host a few small websites. One of them is .NET based and needs IIS, the others are PHP based and need Apache. So, I have both IIS 7 and Apache 2.2.x installed on my server with IIS on port 80 and Apache running on port 8080.

I would like to set up IIS to work as a reverse proxy, forwarding the requests for the Apache sites to port 8080 and serving the requests for the .NET site itself based on the host headers. Like this:

www.mydotnetsite.com/* -> IIS -> serve from IIS
www.myapachesite.com/* -> IIS -> forward to apache on port 8080
www.myothersite.com/*  -> IIS -> forward to apache on port 8080

I did a bit of googling and it seemed like the Application Request Routing feature would do what I needed, but I can't seem to get it to work the way I want it to. I can get it to forward ALL traffic to the Apache server and I can get it to forward traffic with a specific URL pattern to the Apache server, but I can't seem to get it to forward based on the host headers (e.g. "forward all requests for www.apachesite.com -> localhost:8080")

So the question is, how would I go about configuring ARR to do this? Or do I need a different tool?

I'm also open to using Apache as the reverse proxy and forwarding the .NET site requests to IIS instead if that's easier (running Apache on port 80 and IIS on 8080).

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I suggest reversing things. You will have far less trouble by running Apache on port 80 and having it perform the proxy duties, with IIS on 8080.

share|improve this answer
    
You're right - spent about 2 hours already trying to figure this out for IIS. After 30 minutes of looking into mod_proxy and the [P] rewrite rule, I now have this up and running in Apache. –  Eric Petroelje Aug 18 '09 at 2:42

Eric, this is an old question now but I'll leave an answer on the ARR option for future readers. To redirect based on the host headers, use {HTTP_HOST} in the Conditions section. ARR supports redirect logic based on all server variables, so you have plenty of flexibility (as much as mod_proxy).

share|improve this answer
    
ARR is definitely the way to go. I used it for redirecting to TeamCity. –  Bronumski Oct 27 '10 at 13:27

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.