« Previous Next »

Thread: Reverse Proxy to a different WebApp on the same machine

Last post 02-09-2009 6:28 PM by Digital3. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 02-09-2009, 6:12 AM

    • Digital3
    • Not Ranked
    • Joined on 02-09-2009, 5:45 AM
    • Posts 2

    Reverse Proxy to a different WebApp on the same machine

    We are running SharePoint (WebApp1) and a standard ASP.NET application (WebApp2) on the same server, and want to expose these two apps on the web using a single domain/host header with transparent mapping between the applications depending on the path.

    Can ARR + URL Rewrite be configured so that:

    1. Requests to http://acme.example.org/sites/* are proxied to WebApp1 (SharePoint)

    2. Requests to http://acme.example.org/* (all other paths) are proxied to WebApp2

    I've looked at this thread for help, however it involved routing requests to a different webserver process on the same box.

    I set up a third dummy app (WebApp3) bound to acme.example.org:80 to proxy requests to WebApp1 (bound to *:8080) and WebApp2 (bound to *:8090) based on the request path, but all I succeeding in doing was crashing the w3wp.exe worker process with a logged fault in requestRouter.dll. Perhaps there was some infinite loop. I'm testing this on Vista x64.

    The rules I tried for WebApp3 were

    <rule name="Proxy SharePoint" stopProcessing="true">
      <match url="^(sites/.*)" />
      <action type="Rewrite" url="http://localhost:8080/{R:1}" />
    </rule>

    <rule name="Proxy ASP.NET" stopProcessing="true">
      <match url="(.*)" />
      <action type="Rewrite" url="http://localhost:8090/{R:1}" />
    </rule>

    Is it possible to have ARR reroute a request back into the same IIS instance (same machine), but to a different web application within that instance?

    Cheers

    Allister

  • 02-09-2009, 1:24 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: Reverse Proxy to a different WebApp on the same machine

    The rules above should work - and don't really need to run those 2 apps on separate port if you do not want to.  The crash is because of a bug in the RC release when doing windows authentication against a server which is not part of a webfarm.  A possible workaround for the crash would be to create 2 webfarms, one with localhost:8080 in it and the other with localhost:8090 in it and change the url-rewrite rules to route requests to the respective webfarms rather than localhost:8080/localhost:8090 directly.  Or if you can wait just a few days, the RTW release (which has this fixed) will be out very very soon.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 02-09-2009, 6:28 PM In reply to

    • Digital3
    • Not Ranked
    • Joined on 02-09-2009, 5:45 AM
    • Posts 2

    Re: Reverse Proxy to a different WebApp on the same machine

    Cheers for that info. Will wait for RTW.

    I'm wondered if I could simplify this setup by:

    1. Binding WebApp2 (the ASP.NET app) to acme.example.org:80

    2. Binding WebApp1 (the SharePoint app) to acme-internal-sp:80

    3. Eliminating WebApp3 (dummy proxy WebApp)

    4. Add this rule to WebApp2

    <rule name="Proxy SharePoint" stopProcessing="true">
      <match url="^(sites/.*)" />
      <action type="Rewrite" url="http://acme-internal-sp/{R:1}" />
    </rule>

    For requests not matching this rule, the ASP.NET app would be left to serve it, which is what I want.

    The question I have if I did this is how to route to the SharePoint app. As I understand it, I can put it on a different port, or use hostheaders. If I bound SharePoint to acme-internal-sp:80 and didn't register acme-internal-sp as a DNS entry, would the routing module still correctly proxy it, or would it go hunting the network to find the IP of acme-internal-sp? Effectively, I just want it routed back into localhost port 80, but with a new host header.

Page 1 of 1 (3 items)
Microsoft Communities