我在我的tomcat (9)服务器上部署了3个war文件。我最近增加了SSL配置,工作正常,并自动将所有http请求重定向到https。
问题是,我只需要将一些应用程序重定向到https。其他的应该与http和https一起工作。它们以下列方式开放:
backOne和backTwo不应该重定向到https。
我尝试过各种<url-pattern>在web.xml中,但似乎没有实现上述场景。
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Context</web-resource-name>
<url-pattern>/frontApp</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint><security-constraint>
<web-resource-collection>
<web-resource-name>Protected Context</web-resource-name>
<url-pattern>/backTwo</url-pattern>
</web-resource-collection>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Context</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>在这里经历了很多问题。This是最近的,但我搞不懂。
对不起,如果答案很明显,我看不见。对猫没有太多的经验。
发布于 2022-06-28 21:08:48
将保密数据传输的约束放入frontApp的web.xml中。因为你没有重定向,所以其他人不会对他们施加这样的约束。不需要修改全局服务器配置。
https://stackoverflow.com/questions/72793016
复制相似问题