Nginx+Tomcat配置https
2021-06-18 03:05
标签:_for ssl lan style listen cat ack director pass 浏览器和 Nginx 之间走的 HTTPS 通讯,而 Nginx 到 Tomcat 通过 proxy_pass 走的是普通 HTTP 连接。 修改配置文件时,注意红色部分 证书是腾讯云申请的免费证书:https://console.qcloud.com/ssl Nginx+Tomcat配置https 标签:_for ssl lan style listen cat ack director pass 原文地址:http://www.cnblogs.com/goldlone/p/7263791.htmlNginx + Tomcat 配置 HTTPS
1、总述
2、Nginx配置(nginx.conf),部分
http {
#HTTPS server
server {
listen 443 ssl;
server_name goldlone.cn;
#证书地址
ssl_certificate ./1_goldlone.cn_bundle.crt;
ssl_certificate_key ./2_goldlone.cn.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
proxy_connect_timeout 240;
proxy_send_timeout 240;
proxy_read_timeout 240;
# note, there is not SSL here! plain HTTP is used
proxy_pass http://127.0.0.1:8080;
}
}
}
3、Tomcat配置(server.xml),部分
4、结束