码迷,mamicode.com
首页 > Web开发 > 详细

nginx负载均衡转发https

时间:2019-09-23 18:09:23      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:pre   rc4   负载均衡   list   pow   str   prot   bsp   nginx配置   

A服务器做负载转发到  B,C两台服务器 ;

这时候要添加https域名,则以下是A服务器的nginx配置

 

upstream backend {
server ip;
server ip2;
}

 

server {
listen 80;
listen 443 ssl;
server_name localhost;

#这个注释掉才能访问http端口
#ssl on;
ssl_certificate /etc/nginx/conf.d/cert/1.crt;
ssl_certificate_key /etc/nginx/conf.d/cert/2.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;

location / {
add_header X-Content-Type-Options nosniff;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_hide_header X-Powered-By;
proxy_hide_header Vary;

proxy_pass http://backend;
proxy_redirect off;
}

}

nginx负载均衡转发https

标签:pre   rc4   负载均衡   list   pow   str   prot   bsp   nginx配置   

原文地址:https://www.cnblogs.com/cyq632694540/p/11573618.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!