某个客户上的nginx端口转发负载均衡解决方案



############################g101#########################


     upstream g101h{
         ip_hash;
         server 121.127.230.14:25100;
         server 121.127.230.14:25100;
     }
     upstream g101a{
         ip_hash;
         server 121.127.230.14:25110;
         server 121.127.230.14:25110;
     }
     upstream g101w{
         ip_hash;
         server 121.127.230.14:25111;
         server 121.127.230.14:25111;
     }


    server {
        listen 80;
        server_name 607799.xls-cp168.ws;
        server_name 463878.xls-cp168.ws;
        server_name 343453.xls-cp168.ws;
        server_name 138161.xls-cp168.ws;


        rewrite ^(.*)$ https://$host$1 permanent;
     }


    server {
        listen 80;
        server_name 94294567.xls-cp168.ws;
        server_name 87842898.xls-cp168.ws;
        server_name 41126879.xls-cp168.ws;
        server_name 25375558.xls-cp168.ws;


        rewrite ^(.*)$ https://$host$1 permanent;
     }


    server {
        listen 80;
        server_name 7812205041.xls-cp168.ws;
        server_name 5914770308.xls-cp168.ws;
        server_name 5050478538.xls-cp168.ws;
        server_name 1499691239.xls-cp168.ws;

        rewrite ^(.*)$ https://$host$1 permanent;
     }

    server {
        listen 443 ssl http2;
        server_name 607799.xls-cp168.ws;
        server_name 463878.xls-cp168.ws;
        server_name 343453.xls-cp168.ws;
        server_name 138161.xls-cp168.ws;

        #access_log  /var/log/nginx/g101.h.ssl.log;
        location / {
            proxy_pass http://g101h ;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            #try_files $uri $uri/ =404;
        }
        ssl_certificate /etc/letsencrypt/live/xls-cp168.ws/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/xls-cp168.ws/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
     }

    server {
        listen 443 ssl http2;
        server_name 94294567.xls-cp168.ws;
        server_name 87842898.xls-cp168.ws;
        server_name 41126879.xls-cp168.ws;
        server_name 25375558.xls-cp168.ws;


        #access_log  /var/log/nginx/g101.a.ssl.log;
        location / {
            proxy_pass http://g101a ;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            #try_files $uri $uri/ =404;
        }
        ssl_certificate /etc/letsencrypt/live/xls-cp168.ws/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/xls-cp168.ws/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
     }

    server {
        listen 443 ssl http2;
        server_name 7812205041.xls-cp168.ws;
        server_name 5914770308.xls-cp168.ws;
        server_name 5050478538.xls-cp168.ws;
        server_name 1499691239.xls-cp168.ws;

        #access_log  /var/log/nginx/g101.w.ssl.log;
        location / {
            proxy_pass http://g101w ;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            #try_files $uri $uri/ =404;
        }
        ssl_certificate /etc/letsencrypt/live/xls-cp168.ws/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/xls-cp168.ws/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
     }

############################g101#########################
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值