我的 SSL 配置 Web 应用程序(部署在 tomcat(8080 端口))中的 Web.xml 配置如下
<security-constraint>
<web-resource-collection>
<web-resource-name>HTTPSOnly</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
当我尝试 https://google.com , 我正在获取页面 当我尝试 http://google.com ,它会自动重定向到 https://google.com:8443 .所以我没有收到该页面。
我希望它重定向到 https://google.com而不是 https://google.com:8443 .
请帮助我。如果您需要任何进一步的详细信息,会通知您。
最佳答案
我明白了。 从 tomcat 的 server.xml 中删除了 SSL redirectPort
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000" redirectPort="8443" />
喜欢,
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000" />
关于web-applications - 如何避免重定向到 SSL 端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14643441/