« Previous Next »

Thread: Proxy requests from HTTPS to internal HTTP

Last post 07-01-2009 12:39 PM by wonyoo. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 07-01-2009, 7:11 AM

    Proxy requests from HTTPS to internal HTTP

    I have an application server installed, listening for HTTP traffic on a port which is not blocked from the world by a firewall. I wish to expose the services offered by this application only through HTTPS, preferably as a "sub directory" of the HTTPS site already hosted by the server.

    Using IIS7 Url Rewriting, I am able to setup a rule that redirects all traffic to a sub path of my existing HTTPS site. However, I am facing some trouble, when trying to make the same rule route to my server farm setup - all requests matching the rule simply get 404 reponses. Adding the very same rule to a non-SSL site, yields the expected behaviour - the application services are proxied right trough.

    What might be wrong in my setup? Is ARR proxying the HTTPS requests as HTTPS traffic to the application server? The application I want to host does not have a HTTPS interfaces so, if yes: can I tell it not to do so?

    Thanks in advance!

  • 07-01-2009, 7:35 AM In reply to

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

    Re: Proxy requests from HTTPS to internal HTTP

    Your url-rewrite and arr configuration and failed request trace log for the request in question would be helpful.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 07-01-2009, 8:31 AM In reply to

    Re: Proxy requests from HTTPS to internal HTTP

    From the web.config in my front-end HTTPS site:

    <rewrite>
        <rules>
            <rule name="SSRS2008" enabled="true" stopProcessing="true">
                <match url="^reports/.*$" />
                <action type="Rewrite" url="http://SSRS2008/{R:0}" />
            </rule>
        </rules>
    </rewrite>

    From %windir%\system32\inetsrv\applicationHost.config:

    <webFarms>
        <webFarm name="SSRS2008" enabled="true">
            <server address="127.0.0.1" enabled="true">
                <applicationRequestRouting httpPort="8000" httpsPort="8000" />
            </server>
            <applicationRequestRouting>
                <protocol timeout="02:30:00" />
            </applicationRequestRouting>
        </webFarm>
        <applicationRequestRouting>
            <hostAffinityProviderList>
                <add name="Microsoft.Web.Arr.HostNameRoundRobin" />
                <add name="Microsoft.Web.Arr.HostNameMemory" />
            </hostAffinityProviderList>
        </applicationRequestRouting>
    </webFarms>

  • 07-01-2009, 8:43 AM In reply to

    Re: Proxy requests from HTTPS to internal HTTP

    And a failed request trace log:

    http://foto.birkegruppen.dk/trace/fr000001.xml

  • 07-01-2009, 10:41 AM In reply to

    Re: Proxy requests from HTTPS to internal HTTP

    The web site I want to use as the "container" for the proxy directory is buildt with ASP.NET MVC, and utilizes the URL routing provided with the framework. It seems that this routing module interferes with the IIS url rewriting, and causes the 404 error.

  • 07-01-2009, 12:39 PM In reply to

    • wonyoo
    • Top 50 Contributor
    • Joined on 12-15-2007, 1:46 PM
    • Posts 125

    Re: Proxy requests from HTTPS to internal HTTP

    David

    Thanks for making the tracing rule available.  (However, it looks like you must have enabled the tracing after URL rewrite and ARR have been installed.  Did you know that URL rewrite and ARR can write more detailed information to tracing?    http://learn.iis.net/page.aspx/488/using-failed-request-tracing-rules-to-troubleshoot-application-request-routing-arr/   If you do not see RequestRouting and Rewrite in the Area section, then it is probably because tracing was enabled after these modules have been installed.  If that's the case, you can simply repair the two installations via add-remove programs.)

    However, not having additional info doesn't really matter with this investigation.

    What you have stated is exactly right.  If you go to the compact view of the log, the line number 30 is where the IIS URL rewrite module has changed the URL:

    OldUrl="/reports/Pages/Folder.aspx", NewUrl=http://SSRS2008/reports/Pages/Folder.aspx

    And it is correctly routing the request to the serverfarm.

    However, the line number 84 rewrites it to:

    OldUrl="http://SSRS2008/reports/Pages/Folder.aspx", NewUrl="/UrlRouting.axd"

    and then again the line number 98 rewrites it to:

    OldUrl="/UrlRouting.axd", NewUrl="/reports/Pages/Folder.aspx"
    Which is why it is resulting in 404.
     
Page 1 of 1 (6 items)
Microsoft Communities