« Previous Next »

Thread: ARR and IE proxy issue

Last post 05-08-2009 3:54 PM by anilr. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 05-04-2009, 3:05 PM

    • njhansen
    • Not Ranked
    • Joined on 05-01-2009, 9:03 PM
    • Posts 7

    ARR and IE proxy issue

    I'm having a strange issue with ARR, IIS7, and IE.

    I've set up ARR version 1 on an IIS7 server, enabled the proxy setting at the global level, and set up URLRewrite rules to send some requests to another server. Everything works fine when viewing the resulting pages in FireFox and Safari, but IE (6, 7, or 8) complains that

    Internet Explorer cannot download <filename> from <hostname>

    Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.

    I've done a packet capture, and the correct HTML is being returned, as far as I can tell; however IE refuses to display it.

    I found several posts for earlier versions of IIS advising to set the expiration date on the content to some point in the future instead of immediately, which I tried without success (which I don't want to do anyway, since the content is dynamic, and I don't want it cached).

    Size of the resulting HTML doesn't seem to make any difference, and I've got the server to which requests are proxied returning bare-bones headers.

    Now, for the additional oddity. On IE 8 only, the page will display correctly every other time. It is very consistently failing the first time, then succeeding the second, and so on. Thought it might be a caching issue, but waiting significant time between the first and second hit does not seem to change the behavior. Packet tracing reveals no significant difference between the request that fails and the request that succeeds (just timestamps and sequence numbers).

    Turning on failed request logging for 200's didn't help much. Failures on IE 8 and others seem very similar (a few minor header differences, and a different port for the proxied request). The successful return has a bunch of MODULE_PRECONDITION_NOT_MATCH entries before and after the GENERAL_GET_URL_METADATA entry (16 before, 12 after), but no other differences that seemed important.

    I'm not sure whether the fault is with ARR, IIS, or IE. I suspect ARR, since this only happens on pages that are being proxied to another server (many static and dynamic pages work fine that are served from the local machine, mostly ASP.NET and some PHP).

  • 05-04-2009, 3:18 PM In reply to

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

    Re: ARR and IE proxy issue

    A few questions:

    1) What is the exact config setting for the ARR in question?  Could you provide the config sections for URL rewrite and ARR?

    2) What is the connection setting in IE?

    3) What is the security setting in IE?

  • 05-04-2009, 4:05 PM In reply to

    • njhansen
    • Not Ranked
    • Joined on 05-01-2009, 9:03 PM
    • Posts 7

    Re: ARR and IE proxy issue

    Thanks for the quick reply. Here is the information you requested:

    ARR / URL Rewrite config:

    From applicationhost.config:
    ConfigSections:
                <sectionGroup name="rewrite">
                    <section name="rules" overrideModeDefault="Allow" />
                    <section name="globalRules" overrideModeDefault="Deny" allowDefinition="AppHostOnly" />
                    <section name="rewriteMaps" overrideModeDefault="Allow" />
                </sectionGroup>
                <section name="applicationRequestRouting" overrideModeDefault="Deny" allowDefinition="AppHostOnly" />

    GlobalModules:
                <add name="RewriteModule" image="%SystemRoot%\system32\inetsrv\rewrite.dll" />
                <add name="ApplicationRequestRouting" image="%ProgramFiles%\IIS\Application Request Routing\requestRouter.dll" />

    System.WebServer:
    (We have lots of rules; I've tried to eliminate ones that could have no bearing on the situation at hand).
            <rewrite>
                <globalRules>
                    <clear />
                    <rule name="HTTP on" enabled="true" stopProcessing="true">
                        <match url=".*" />
                        <conditions>
                            <add input="{REQUEST_URI}" pattern="(.*)/ssl/(.*)" />
                        </conditions>
                        <action type="Redirect" url="https://{HTTP_HOST}{C:1}/{C:2}" appendQueryString="false" redirectType="Found" />
                    </rule>
                    <rule name="HTTPS off" enabled="true" stopProcessing="true">
                        <match url=".*" ignoreCase="false" />
                        <conditions>
                            <add input="{REQUEST_URI}" pattern="(.*)/ssloff/(.*)" />
                        </conditions>
                        <action type="Redirect" url="http://{HTTP_HOST}{C:1}/{C:2}" appendQueryString="false" redirectType="Found" />
                    </rule>
                    <rule name="Portifier" enabled="true" stopProcessing="true">
                        <match url="(.*):(.*)" />
                        <action type="Redirect" url="http://{HTTP_HOST}:{R:2}/{R:1}" appendQueryString="false" redirectType="Found" />
                    </rule>
                    <rule name="4DCGI to script" enabled="true" stopProcessing="true">
                        <match url="(.*)4DCGI/(.*)" />
                        <conditions>
                            <add input="{URL}" pattern="(.*)/4DCGI/(.*)" />
                        </conditions>
                        <action type="Redirect" url="{C:1}/script/{C:2}" appendQueryString="false" redirectType="Found" />
                    </rule>
                    <rule name="Secure Script" enabled="false" stopProcessing="true">
                        <match url=".*script/.*" />
                        <conditions>
                            <add input="{REQUEST_URI}" pattern="/script/.*" />
                            <add input="{HTTPS}" pattern="off" />
                        </conditions>
                        <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" redirectType="Found" />
                    </rule>
                    <rule name="shtml to A4D" stopProcessing="true">
                        <match url=".+\.shtml(.*)?" />
                        <conditions>
                            <add input="{HTTP_HOST}" pattern="(www|temp|test)?(\..*)" />
                        </conditions>
                        <action type="Rewrite" url="http://a4d{C:2}/4DCGI{REQUEST_URI}" appendQueryString="false" />
                    </rule>
                </globalRules>
            </rewrite>
            <applicationRequestRouting>
                <protocol httpVersion="Http11" keepAlive="true" preserveHostHeader="false" reverseRewriteHostInResponseHeaders="true" addXForwardedForHeader="false" />
            </applicationRequestRouting>
    (tried different combinations on these ones)

    location.system.webserver.modules:
                    <add name="RewriteModule" />
                    <add name="DigestAuthenticationModule" lockItem="true" />
                    <add name="ApplicationRequestRouting" />

    From site web.config:
    (both domains mentioned are inside our firewall; test. is the server that handles the incoming requst; testa4d. is the backend server to receive proxied requests
            <rewrite>
                <rules>
                    <rule name="Enforce Main Domain" stopProcessing="true">
                        <match url=".*" />
                        <conditions>
                            <add input="{HTTP_HOST}" negate="true" pattern="test\.campopines\.com" ignoreCase="false" />
                        </conditions>
                        <action type="Redirect" url="http://test.campopines.com{REQUEST_URI}" appendQueryString="false" redirectType="Permanent" />
                    </rule>
                    <rule name="COP A4D" stopProcessing="true">
                        <match url="^script/(.*)" />
                        <action type="Rewrite" url="http://testa4d.campopines.com/4DCGI/{R:1}" />
                    </rule>
                    <rule name="COP Default Redirect" stopProcessing="true">
                        <match url="^$|^default.html$" />
                        <action type="Redirect" url="https://{HTTP_HOST}/script/default.html" redirectType="Found" />
                    </rule>
                </rules>
            </rewrite>

     

    Connection settings in IE I'm not as clear on what you need. I've tried it both with and without our internal proxy. Without the proxy, nothing is set on the connection tab or checked in the proxy subscreen from the connection tab.

    The page is considered to be in the internet zone, medium security, protected mode on (IE 8). Since the page will never come up under IE 6 or 7, I cannot verify, but the zone and medium security should be the same. Just for kicks, I put it into the trusted sites list, and that made no difference (IE 7). Also turned protected mode off (IE 8) -- also no difference.

  • 05-07-2009, 3:39 PM In reply to

    • njhansen
    • Not Ranked
    • Joined on 05-01-2009, 9:03 PM
    • Posts 7

    Re: ARR and IE proxy issue

    OK, further information on this. I believe that the issue may be with the content type header. The backend server is returning a two content type headers

    Content-Type: text/html
    Content-type: text/html;Charset=ISO-8859-1

     However, when the result gets translated by IIS, the resulting single header is

    Content-Type: text/html,text/html;Charset=ISO-8859-1

    I dummied up a socket application to return arbitrary headers and HTML, and removing the extra text/html seems to correct the problem, although I cannot guarantee that it works for more complex HTML than the very simple stuff that I was returning. Full responses below.

    Original response (backend server) displays correctly in IE
    HTTP/1.0 200 OK
    Server: 4D_WebStar_D/6.74
    Cache-Control: no-cache
    Pragma: no-cache
    Expires: Tue, 05 May 2009 17:56:52 GMT
    Content-Type: text/html
    Date: Tue, 05 May 2009 17:56:52 GMT
    Last-Modified: Tue, 05 May 2009 17:56:52 GMT
    Expires: Wed, 06 May 2009 17:56:52 GMT
    Content-type: text/html;Charset=ISO-8859-1
    Content-Length: 41

    <html>
    <body>
     hi
    </body>
    </html>

     

    Response after begin proxied by ARR does not display correctly in IE
    HTTP/1.1 200 OK
    Cache-Control: no-cache
    Pragma: no-cache
    Content-Length: 41
    Content-Type: text/html,text/html;Charset=ISO-8859-1
    Expires: Tue, 05 May 2009 17:54:29 GMT,Wed, 06 May 2009 17:54:29 GMT
    Last-Modified: Tue, 05 May 2009 17:54:29 GMT
    Server: Microsoft-IIS/7.0
    X-Powered-By: ASP.NET
    Date: Tue, 05 May 2009 17:54:17 GMT

    <html>
    <body>
     hi
    </body>
    </html>

     

    My hacked up response displays correctly in IE
    HTTP/1.1 200 OK
    Cache-Control: no-cache
    Pragma: no-cache
    Content-Length: 41
    Content-Type: text/html;Charset=ISO-8859-1
    Expires: Tue, 05 May 2009 17:54:29 GMT,Wed, 06 May 2009 17:54:29 GMT
    Last-Modified: Tue, 05 May 2009 17:54:29 GMT
    Server: Microsoft-IIS/7.0
    X-Powered-By: ASP.NET
    Date: Tue, 05 May 2009 17:54:17 GMT

    <html>
    <body>
     hi
    </body>
    </html>

     

    All that said, does anyone know how I could

    1. Get ARR to aggregate instead of append duplicate headers (similar behavior with content expiration) or
    2. Get IIS7 to treat the type text/html,text/html;Charset=ISO-8859-1as if it were just one or the other or
    3. Get IE to display the content in spite of the somewhat odd headers

    I'm assuming that since that content type isn't one of the "normal" types that IE thinks it has to download the file, but cannot store it, since the content cannot be cached. I'm just not sure what the "right" workaround is. I definitely don't want to turn on caching, since this is dynamic content being served with a .html extension.

  • 05-08-2009, 3:54 PM In reply to

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

    Re: ARR and IE proxy issue

    We can probably make a change to use the last Content-Type header rather than munging it together (which is probably what the browser does anyway).  I will open a bug for the next beta of ARRv2 regarding this.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
Page 1 of 1 (5 items)
Microsoft Communities