We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

ARR as a proxyRSS

14 replies

Last post Jan 20, 2014 05:55 PM by VijetaK

  • ARR as a proxy

    Oct 29, 2008 08:17 AM|k_sega|LINK


     I'm still looking for a way to use IIS like a proxy. Actually I want to create module for additional analysis of html code, that goes thru that proxy.

    In the article http://blogs.iis.net/wonyoo/archive/2008/07/26/relationship-between-application-request-routing-and-url-rewrite-modules.aspx the author writes that ARR checks whether the URL matches any server group name. In case if it does not match it is working as proxy.

    So, I do following:

    1. <div mce_keep="true">Set no rules for URL rewriter</div>
    2. <div mce_keep="true">Set no server groups for ARR</div>
    3. <div mce_keep="true">Set proxy in LAN settings of connection tab to</div>
    4. <div mce_keep="true">Go to microsoft.com and see IIS7 welcome page.</div>

     Then I've tried to create one rule for URL rewriter - wildcard:* and action {R:0}

    And it seems that ARR does not works again.

     Can you describe how to use ARR as proxy more detailed please. Thanks in advance.

  • Re: ARR as a proxy

    Oct 29, 2008 12:57 PM|anilr|LINK

    Your rule would look like below

          <rule name="Proxy" patternSyntax="Wildcard" stopProcessing="true">
            <match url="*" />
              <add input="{HTTP_HOST}" pattern="*" />
            <action type="Rewrite" url="http://{C:0}/{R:0}" />

    note that you can only use ARR for http forward proxy and not https forward proxy because we do not support the CONNECT verb.

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: ARR as a proxy

    Nov 01, 2008 12:42 PM|k_sega|LINK

    Ok! great! Thats what I need. But! I've written almost the same myself using managed IIS Handler. Actually it's great to have IIS7's power in hand. The problem in ARR as proxy and my module - incorrect behavior when authentication is required. As far as I understand if I set proxy in IE - it starts send header proxy-connection instead of connection. And so, after server responds "401" no windows with login/password request is shown. Do you know the workaround?
  • Re: ARR as a proxy

    Nov 03, 2008 12:14 PM|anilr|LINK

    The authentication problem with ARR TP1 is fixed in the upcoming RC release - I don't know what problem your handler has.

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: ARR as a proxy

    Nov 07, 2008 01:05 PM|k_sega|LINK

    One more problem I've made everythink you say - set rule below for Url rewriter, no settings to ARR. And I've added my managed module to analyze all requests. And it has worked for some time... But after some manipulations (seems that I did nothing special with it) my module fails every request.

    Details of failure:
    1. IIS calls method Init of my module
    2. IIS writes following to the application event log:

    Event code: 3005
    Event message: An unhandled exception has occurred.
    Event time: 11/7/2008 8:50:34 PM
    Event time (UTC): 11/7/2008 5:50:34 PM
    Event ID: e57bcc4779884d99b2df5a568f11c141
    Event sequence: 2
    Event occurrence: 1
    Event detail code: 0

    Application information:
    Application domain: /LM/W3SVC/1/ROOT-1-128705538346767737
    Trust level: Full
    Application Virtual Path: /
    Application Path: C:\inetpub\wwwroot\
    Machine name: TEST

    Process information:
    Process ID: 4116
    Process name: w3wp.exe

    Exception information:
    Exception type: NullReferenceException
    Exception message: Object reference not set to an instance of an object.

    Request information:
    Request URL:
    Request path:
    User host address:
    Is authenticated: False
    Authentication Type:
    Thread account name: NT AUTHORITY\LOCAL SERVICE

    Thread information:
    Thread ID: 5
    Thread account name: NT AUTHORITY\LOCAL SERVICE
    Is impersonating: False
    Stack trace: at System.Web.Security.CookielessHelperClass.RemoveCookielessValuesFromPath()
    at System.Web.HttpContext.Init(HttpRequest request, HttpResponse response)
    at System.Web.HttpContext..ctor(HttpWorkerRequest wr, Boolean initResponseWriter)
    at System.Web.Hosting.PipelineRuntime.CreateContext(IIS7WorkerRequest wr, IntPtr nativeRequestContext)

    3. If I remove my module from the list - it starts working as proxy.
    It seems that the rule was executed, but managed context can't be created. Also I suppose that the order of modules can influence on it.

    What do you think about it? Thanks in advance.
  • Re: ARR as a proxy

    Nov 10, 2008 05:13 PM|k_sega|LINK

    Any ideas? Need more information?
    More comments. When I set any (even empty) managed module and set up URL rewriter together with ARR I get 400.0 error whith "ASP.NET detected invalid characters in the URL". .NET framework code analysis shows that the HttpContext.Current.Request has no fields filled.
    Seems that URL Rewrute and ARR do not allow to use any managed module together with them. Am I wrong?
    I can create dump of the process on exception, provide settings of my IIS, provide more information that can be helpfull to find the root cause of the problem.
    Hope your help. Thanks in advance
  • Re: ARR as a proxy

    Nov 18, 2008 06:11 PM|anilr|LINK

    Sorry, could not look at this earlier.  I am able to repro this now, seems like a null reference exception in asp.net - I am following up with the asp.net team.

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: ARR as a proxy

    Nov 18, 2008 07:23 PM|k_sega|LINK

    Thank you for your answer. Please take a look at my though here: http://forums.iis.net/p/1153181/1885282.aspx#1885282 Is it correct?

  • Re: ARR as a proxy

    Nov 24, 2008 05:09 PM|anilr|LINK

    No, that is not the cause.  The cause for the error is now understood and we are planning to fix it for the next version of IIS/ASP.Net.  If you would like a hotfix for the current version of IIS/ASP.Net, can you explain why you want to use a managed module with ARR in more detail?

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: ARR as a proxy

    Dec 03, 2008 05:29 AM|k_sega|LINK

    We wanted to use it for testing purposes as our internal product. I do not think that will escalate it to an appropriate level for you to generate a hotfix. When will it possible to use ARR in such way? What version of ASP.NET or IIS you think will fix this bug?
  • Re: ARR as a proxy

    Dec 03, 2008 04:45 PM|anilr|LINK

    We are currently planning to fix this in windows server 2008 R2

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: ARR as a proxy

    Jan 15, 2009 10:39 AM|pascal06|LINK


    I'm facing with the same issue,

    Using any other http module break the pipeline,

    Any news regarding the fix ?


    Best regards, 

  • Re: ARR as a proxy

    Jan 28, 2009 08:03 PM|anilr|LINK

    This is being fixed for win7 and ws08 R2 - if you need it fixed for ws08, can you provide some business reason we can use to push for a qfe?

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: ARR as a proxy

    Oct 20, 2010 03:18 PM|aaronhbridges|LINK

     Is it possible to get a fix for 2008 R1?


    We are hosting on Amazon so do not have R2 as an option.



  • Re: ARR as a proxy

    Jan 20, 2014 05:55 PM|VijetaK|LINK

    Is it possible to set up IIS as a forward proxy for both HTTP and HTTPS Requests