tomcat8.5
conf/web.xml中修改 最后边增加
<!-- http协议自动转 https -->
<security-constraint>
<web-resource-collection >
<web-resource-name >SSL</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

博客介绍了在Tomcat8.5的conf/web.xml文件中进行配置,实现http协议自动转https的方法。通过在文件最后添加特定的security - constraint配置代码,可完成该功能。

1001

被折叠的 条评论
为什么被折叠?



