IIS 7.5 Application Initialization (Warm-up) and HTTPS

谁说我不能喝 提交于 2020-01-13 09:59:07

问题


We've been using the Application Initialization module with IIS 7.5 for quite a while now, and it always worked perfectly.

However, we've just started implementing SSL, and it seems to create a conflict with the warm-up. I've done quite a bit of research, but no solution worked so far.

Basically the issue is that the initialization module doesn't follow redirections. We have to keep http enabled for a certain part of the site, but we do redirect all other HTTP visits to their HTTPS equivalent. I've solved this using a rewrite rule, that throws a 302 to the https page. The initialization receives this 302, but just ignores it.

Solutions I've tried:

APP_WARMING_UP server variable

This one would make the most sense. I could simply make the rewrite rule ignore every request whenever {APP_WARMING_UP} returns 1. According to the documentation this is set to 1 as long as the initialization is still running. This unfortunately doesn't work at all, as {APP_WARMING_UP} simply returns an empty string at all times. Maybe this is a limitation with 7.5? (See my rewrite rule below.)

Change the initialization page to the HTTPS version

Currently it's configured like this:

    <applicationInitialization remapManagedRequestsTo="Warmup.htm" skipManagedModules="true" doAppInitAfterRestart="true">
        <add initializationPage="/WarmUp?id=1" />
    </applicationInitialization>

I tried changing the URL to "https://{HTTP_HOST}/Login/WarmUp?id=1" and even replaced the {HTTP_HOST} with the absolute address, but both configurations seem to completely disable the application initialization. It doesn't even make a page request anymore.

This is the documentation on the module:

http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization

This is my rewrite rule which is basically being the culprit in the whole ordeal. It's the only one.

<rule name="HTTP to HTTPS redirect" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
        <add input="{APP_WARMING_UP}" pattern="1" negate="true" />
        <add input="{REQUEST_URI}" pattern="/services" negate="true" />
        <add input="{HTTPS}" pattern="off" />
    </conditions>
    <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" logRewrittenUrl="true" />
    <serverVariables>
        <set name="SKIP_MANAGED_MODULES" value="0" />
    </serverVariables>
</rule>

Anyone able to help?


回答1:


This may help. The module seems to not work with sites where SSL is required. See this KB issue. I'm guessing the module kicks of an http request instead of an https.

You might want to create a page which allows for http and doesn't redirect to https.



来源:https://stackoverflow.com/questions/19033744/iis-7-5-application-initialization-warm-up-and-https

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!