【问题标题】:How to force https on wildfly 8.1 in openshift?如何在openshift中对wildfly 8.1强制https?
【发布时间】:2014-08-19 10:43:36
【问题描述】:

所以我让这个应用程序在使用 wildfly 8.1 墨盒的 openshift 上运行。 我想强制所有网址通过 https 而不是 http。

Https 工作正常,但我也可以使用 http 访问相同的页面。这是我要禁用的。

我找到了这篇知识库文章:https://www.openshift.com/kb/kb-e1044-how-to-redirect-traffic-to-https 但这并没有描述 Wildfly 特定的配置。

这是我在 openshift 上来自 wildfly 的standalone.xml 配置:http://pastebin.com/hg7WY5Uj

【问题讨论】:

    标签: https openshift wildfly


    【解决方案1】:

    固定。

    在我的 web.xml 中添加了以下内容:

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Viewpoint Secure URLs</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
    

    这会导致每个 url 重定向到 https。但端口是 8443。为了使用默认端口 443,我调整了我的 config/standalone.xml:

    在socket-binding-group中改变:

    <socket-binding name="https" port="${jboss.https.port:8443}"/>
    

    <socket-binding name="https" port="${jboss.https.port:443}"/>
    

    【讨论】:

    • 如果我没有 web.xml 那么我可以在哪里更改它为undertow
    猜你喜欢
    • 1970-01-01
    • 2016-12-27
    • 1970-01-01
    • 2011-11-23
    • 1970-01-01
    • 2012-01-26
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    相关资源
    最近更新 更多