在https(SSL)上运行整个应用程序时需要公开特定的http url

时间:2018-04-24 11:05:22

标签: java http tomcat ssl https

我在同一个tomcat服务器上运行多个war应用程序,启用了SSL,并且有最终的URL:

  1. https://192.168.110.1:8443/war1
  2. https://192.168.110.1:8443/war2
  3. 除此之外,还可以通过添加server.xml来显示一个目录。

    <Context docBase="../../rawdata" path="/rw"/>
    

    但是尝试公开: http ://192.168.110.1: 8080 /rw/file1.bin。 基本上,我 DONOT 想要将其重定向到 https &amp;的 8443

    我尝试在tomcat的web.xml

    中添加以下代码
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>public</web-resource-name>
            <url-pattern>/rw/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>NONE</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Entire Application</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
    

    但网址仍然通过SSL端口重定向。

    我该怎样防止这种情况?提前谢谢。

0 个答案:

没有答案