1

I am running a WHS 2011 and try to proxy an internal webserver (subsonic) over IIS7. The goal is:

https://external_host/subsonic -> http://internal_host:4040

What I've done so far:

  • Created a Virtual Directory "subsonic" in the Default Web Site
  • List item

Created the Rewrite Rules

Whenever I call the URL https://external_host/subsonic I'll get a 404 while trying to access https://external_host/login.view. login.view is in fact the login page of the internal web server.

Here's the config on the Virtual Directory "subsonic":

    <rewrite>
        <rules>
            <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                <match url="(.*)" />
                <action type="Rewrite" url="http://homeserver:4040/{R:1}" />
            </rule>
        </rules>
        <outboundRules>
            <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
                <match filterByTags="A, Form, Img" pattern="^http(s)?://homeserver:4040/(.*)" />
                <action type="Rewrite" value="http{R:1}://www.external.com/{R:2}" />
            </rule>
        </outboundRules>
    </rewrite>

Is it possible to run a Reverse Proxy on a Virtual Directory at all?

Jenny D
  • 27,780
  • 21
  • 75
  • 114

1 Answers1

2

IIS Application Request Routing (ARR) is the perfect solution to this. We are doing this today proxying a public facing domain to an internally hosted web farm. Basically it is using rewrite rules to accomplish this, but it provides a few extra goodies for reverse proxy as well.

TerryS
  • 136
  • 1
  • I have ARR installed on the server and "proxy" enabled in the configuration, but I still get the same error. Can you give me where I need to configure it? – Matthew Hodgkins Mar 14 '12 at 20:28
  • I assume ARR is on the public facing server. Make sure you have defined a web farm with the internal server as a member. Then you should have a default rewrite rule defined in ARR that forwards all requests to the web farm. On the internal server, make sure you have a binding on the virtual directory which is listening for requests to https://external_host. If the binding isn't set, then the internal server won't know it is suppose to handle the requests and will return a 404. – TerryS Mar 15 '12 at 21:16