Tomcat turns from HTTP to HTTPS, and the port number is removed

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.