Will
<connector port="8080" protocol="http/1.1 " connectiontimeout= "20000 " redirectport="8443 " uriencoding="UTF-8"
Change into
<connector port= "protocol="http/1.1 " connectiontimeout= "20000 " redirectport="443 " uriencoding="UTF-8"
Restart
This allows the user to remove port access to both HTTP and HTTPS.
Another: Force HTTPS access
Add the following paragraph to the </welcome-file-list> in Tomcat\conf\web.xml:
<login-config> for SSL- <auth-method>CLIENT-CERT</auth-method> <realm-name>client Cert users-only area</realm-name> </login-config> < Security-constraint> for SSL- <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>
After completing the above steps, entering the HTTP access address in the browser is also automatically converted to HTTPS.
Tomcat turns from HTTP to HTTPS, and the port number is removed