使用iis8.5和Websphere7的HTTP到HTTPS重定向问题

时间:2017-08-10 04:50:43

标签: iis websphere-7 url-rewrite-module iis-8.5 isapi-rewrite

我们在WebSphere 7.0和Jboss EAP7上托管的应用程序位于IIS 8.5 Web服务器之后,我们为iis启用了ssl。

我们的要求是,每当用户使用http访问时,必须将其重定向到https,为实现此目的,我们在入站规则下面的iis中配置了rewrite2模块

<rules>
    <rule name="http to https" enabled="false" stopProcessing="true">
        <match url="(.*)" />
        <conditions logicalGrouping="MatchAny">
            <add input="{HTTPS}" pattern="^OFF$" />
        </conditions>
        <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="SeeOther" />
    </rule>

问题: - 当我访问http://www.example.com/login时,它会重定向到https://www.example.com/sePlugins/iisWASPlugin_http.dll并提供404状态代码。 (只有应用程序托管了websphere)     问题是我们有一个ISAPI Websphere插件来处理请求,并且由于某种原因,IIS会改变URL。

重定向规则适用于J BOSS上托管的应用程序。

2 个答案:

答案 0 :(得分:0)

不确定我的注册过程发生了什么,但我发布了原始答案,因此在注册后再次重新发布。

我发现在重定向网址中指定{CACHE_URL}而不是https://{HTTP_HOST}{REQUEST_URI}。所以url="{CACHE_URL}"

这是我的规则的定义方式,似乎运作良好。

<rule name="HTTP to HTTPS redirect" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
        <add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" />
    </conditions>
    <action type="Redirect" url="{CACHE_URL}" />
</rule>

答案 1 :(得分:-1)

我发现在重定向网址中指定{CACHE_URL}而不是https://{HTTP_HOST}{REQUEST_URI}。所以url="{CACHE_URL}"