【问题标题】:HTTP to HTTPS redirect issue with iis8.5 and Websphere7iis8.5 和 Websphere7 的 HTTP 到 HTTPS 重定向问题
【发布时间】:2018-01-18 04:08:05
【问题描述】:

我们在 IIS 8.5 Web 服务器后面的 WebSphere 7.0 和 Jboss EAP7 上托管了应用程序,我们为 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 上的应用程序。

【问题讨论】:

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


    【解决方案1】:

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

    我发现在重定向 URL 中指定 {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>
    

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      • 请分享更多细节
      • 请删除此答案。下次,尝试编辑您的答案,而不是创建一个新答案。了解如何使用 Stack Overflow 并遵守基本规则。
      猜你喜欢
      • 1970-01-01
      • 2015-09-08
      • 2017-11-19
      • 2017-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-02
      相关资源
      最近更新 更多