说在前面的话:
突然接到这么一个任务,将多个域名的访问必须使用https的转发访问,其实对niginx的使用很简单,文档也很齐全(不管是腾讯云还是阿里云),入坑的原因是对niginx服务器的陌生和走的弯路。
1.弯路:tomcat支持ssl
修改server.xml文件
port="443"
protocol="org.apache.coyote.http11.http11nioprotocol"
sslenabled="true"
scheme="https"
secure="true"
keystorefile="conf\ssl\生产的证书名称我使用相对路径.jks"
keystoretype="jks"
keystorepass="证书对应的密码"
clientauth="false"
sslprotocol="tlsv1+tlsv1.1+tlsv1.2"
maxthreads="150" ciphers="tls_rsa_with_aes_128_cbc_sha,tls_rsa_with_aes_256_cbc_sha,tls_ecdhe_rsa_with_aes_128_cbc_sha,tls_ecdhe_rsa_with_aes_128_cbc_sha256,tls_rsa_with_aes_128_cbc_sha256,tls_rsa_with_aes_256_cbc_sha256">
keystoretype