问题
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>
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.
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.
回答1:
I got it. Removed SSL redirectPort from server.xml of tomcat
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000" redirectPort="8443" />
like,
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000" />
来源:https://stackoverflow.com/questions/14643441/how-to-avoid-redirecting-to-ssl-port