【问题标题】:Redirect http to https on payara在payara上将http重定向到https
【发布时间】:2020-09-24 17:22:36
【问题描述】:

有人可以告诉我如何在 payara 5 上将 http 重定向到 https

我在应用程序级别的 web.xml 和域级别的 default-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>

【问题讨论】:

    标签: https payara payara-micro


    【解决方案1】:

    您还需要设置重定向端口:https://docs.oracle.com/cd/E26576_01/doc.312/e24938/create-http-redirect.htm#GSRFM00031。在默认的 http 监听器中,端口应该已经设置为 HTTPS 监听器的端口。如果您使用自定义侦听器,请确保将重定向端口设置为 HTTPS 端口。如果您的 Payara 服务器在代理后面运行,您需要将重定向端口设置为代理侦听的 HTTPS 端口,很可能是标准端口 443。

    【讨论】:

    • 我尝试了您提供的链接上的命令,但没有成功。虽然此 link 上的命令运行良好。这是 Payara 的问题吗?!
    猜你喜欢
    • 2013-02-13
    • 2014-11-24
    • 1970-01-01
    • 2017-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-22
    • 2019-06-07
    相关资源
    最近更新 更多