如何避免重定向到 SSL 端口 [英] How to avoid redirecting to SSL port
问题描述
我的 SSL 配置 Web 应用程序中的 Web.xml 配置(部署在 tomcat(8080 端口)上)如下
My Web.xml config in my SSL confugured web app(deployed on tomcat(8080 port)) is as follows
<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.所以我没有得到页面.
When I tried https://google.com, I am getting the page When I tried http://google.com, it automatically redirects to https://google.com:8443. So I am not getting the page.
我希望它被重定向到 https://google.com 而不是 https://google.com:8443.
I want it to be redirect to https://google.com instead of https://google.com:8443.
请帮助我.如果您需要任何进一步的细节,我们会通知您.
Kindly help me. Will let u know if u need any further details.
推荐答案
我明白了.从 tomcat 的 server.xml 中删除了 SSL redirectPort
I got it. Removed SSL redirectPort from server.xml of tomcat
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000" redirectPort="8443" />
喜欢
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000" />
这篇关于如何避免重定向到 SSL 端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!