大旗谷资源网 Design By www.zqyou.com

web端拷贝证书与密钥

   scp -rp -P52113 /application/nginx/conf/key 10.0.0.5:/application/nginx/conf/

在nginx负载均衡服务端配置

vim /application/nginx/conf/nginx.conf

worker_processes 2;
error_log logs/error.log;
events {
  worker_connections 65535;
}
http {
  include    mime.types;
  default_type application/octet-stream;
  sendfile    on;
  keepalive_timeout 65;
 
 
  upstream server_pools {
    server 10.0.0.200:443 weight=1 max_fails=3 fail_timeout=10;
    #server 10.0.0.8:443 weight=1 max_fails=3 fail_timeout=10;
    #server 10.0.0.9:443 weight=1 max_fails=3 fail_timeout=10;
  }
 
  server {
    listen    80;
    server_name localhost;
    rewrite ^(.*)$ https://$host$1 permanent;
  }
  server {
    listen 10.0.0.5:443;
    server_name www.abc.com;
 
    #开启 https 注意要添加在server区块 不能在http区块中放置
    ssl on;
    ssl_certificate /application/nginx/conf/key/server.crt;
    ssl_certificate_key /application/nginx/conf/key/server.key;
 
    location / {
      proxy_pass https://server_pools;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $remote_addr;
    }
  }
}

#检查nginx负载均衡配置

   /application/nginx/sbin/nginx -t

#重启nginx负载均衡

   /application/nginx/sbin/nginx -s stop
   /application/nginx/sbin/nginx

浏览器访问测试

注意修改hosts对应的是负载均衡的IP地址信息

访问测试

如何通过nginx负载均衡跳转https

访问结果

如何通过nginx负载均衡跳转https

标签:
nginx负载均衡配置,nginx负载均衡,nginx负载均衡原理

大旗谷资源网 Design By www.zqyou.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
大旗谷资源网 Design By www.zqyou.com

评论“如何通过nginx负载均衡跳转https”

暂无如何通过nginx负载均衡跳转https的评论...

RTX 5090要首发 性能要翻倍!三星展示GDDR7显存

三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。

首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。

据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。