Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS 7.5 Application Initialization (Warm-up) and HTTPS

Tags:

iis

iis-7

iis-7.5

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?

like image 610
user2820217 Avatar asked Sep 26 '13 16:09

user2820217


1 Answers

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.

like image 69
Bill Christenson Avatar answered Sep 24 '22 23:09

Bill Christenson