3

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).

2 Answers 2

2

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.

1
  • 1
    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. Aug 18, 2009 at 2:42
7

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).

1
  • ARR is definitely the way to go. I used it for redirecting to TeamCity.
    – Bronumski
    Oct 27, 2010 at 13:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .