IIS 7.5应用程序初始化(预热)和HTTPS [英] IIS 7.5 Application Initialization (Warm-up) and HTTPS

查看:132
本文介绍了IIS 7.5应用程序初始化(预热)和HTTPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经将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.

但是,我们才刚刚开始实现SSL,这似乎与预热产生了冲突.我已经做了很多研究,但是到目前为止,没有解决方案.

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.

基本上,问题在于初始化模块不遵循重定向.我们必须在网站的特定部分保持http启用,但是我们会将所有其他HTTP访问重定向到它们的HTTPS等效项.我已经使用重写规则解决了此问题,该规则将302抛出到https页面.初始化收到此302,但忽略它.

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.

我尝试过的解决方案:

APP_WARMING_UP服务器变量

这将是最有意义的.只要{APP_WARMING_UP}返回1,我就可以简单地使重写规则忽略每个请求.根据文档,只要初始化仍在运行,就将其设置为1.不幸的是,这根本不起作用,因为{APP_WARMING_UP}始终始终返回一个空字符串.也许这是7.5的限制? (请参阅下面的重写规则.)

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.)

将初始化页面更改为HTTPS版本

当前配置如下:

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

我尝试将URL更改为"https://{HTTP_HOST}/Login/WarmUp?id = 1",甚至将{HTTP_HOST}替换为绝对地址,但是这两种配置似乎完全禁用了应用程序初始化.它甚至不再发出页面请求.

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.

这是该模块上的文档:

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?

推荐答案

可能有帮助.该模块似乎不适用于需要SSL的网站.请参阅此知识库问题.我猜想是http请求而不是https的模块踢.

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.

您可能想创建一个页面,该页面允许使用http并且不重定向到https.

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

这篇关于IIS 7.5应用程序初始化(预热)和HTTPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆