HTTP到HTTPS重定向tomcat基本URL未重定向

时间:2017-03-28 08:03:31

标签: tomcat ssl redirect

的web.xml

<security-constraint>
<web-resource-collection>
    <web-resource-name>Secured Core Context</web-resource-name>
    <url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
   </user-data-constraint>
</security-constraint>

server.xml中

<Connector SSLEnabled="true" acceptCount="100" clientAuth="false"      connectionTimeout="20000" debug="0" disableUploadTimeout="true" enableLookups="false" keystoreFile="./conf/Community.keystore" keystorePass="****" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" name="SSL" port="9255" scheme="https" secure="true" sslProtocol="TLS" sslProtocols="TLSv1,TLSv1.1,TLSv1.2"/>

<Connector acceptCount="100" connectionTimeout="20000" debug="3" disableUploadTimeout="true" enableLookups="false" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" name="WebServer" port="8090" redirectPort="9255"/> 

我能够在http和https中运行应用程序。访问http://localhost:8090时,它不会重定向到https。但如果我访问http://localhost:8090/html/login.html,它会重定向到https。我在这里缺少什么?

0 个答案:

没有答案