1. Configuring in Tomcat's Conf/server.xml
<ConnectorPort= "443"Protocol= "Org.apache.coyote.http11.Http11Protocol"MaxThreads= "Max"sslenabled= "true"Scheme= "https"Secure= "true"ClientAuth= "false"Sslprotocol= "TLS"Keystorefile= "D:\keystore\zhihu.org.cn\Tomcat\zhihu.org.cn.jks"Keystorepass= "123456"/>
2. point the Redirectport port number to 443
<connectiontimeout= "20000" port= "9002" protocol = "http/1.1" Redirectport = "443" /> < port= "8009" protocol= "ajp/1.3" redirectport = "443" />
3. Configure the bottom of the Conf/web.xml
<Security-constraint><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></Security-constraint>
4. Restart Tomcat and then open it in the browser
Zhihu.org.cn will automatically jump to https://zhihu.org.cn (will show 404)
Open default app https://zhihu.org.cn/examples/to see normal effects
Tomcat Open HTTPS protocol