• nginx 负载均衡设置


    upstream lucky5{
        server 127.0.0.1:3000  weight=10;
        server 127.0.0.1:3001 weight=5;
    }
    server{
        location /
        {
            proxy_pass http://test;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header REMOTE-HOST $remote_addr;
    
           
            add_header my-backendIP $upstream_addr; # 后端转发的代理服务器
            add_header my-backendCode $upstream_status; # 响应状态
    
            add_header X-Cache $upstream_cache_status; # 命中缓存
            
            add_header Cache-Control no-cache; 不缓存
    
            #Set Nginx Cache      
            # proxy_ignore_headers Set-Cookie Cache-Control expires;
            # proxy_cache cache_one;
            # proxy_cache_key $host$uri$is_args$args;
            # proxy_cache_valid 200 304 301 302 1m;
            # expires 12h;
        }
    }
    

    https://blog.csdn.net/caijunsen/article/details/83002219

    http://nginx.org/en/docs/http/ngx_http_upstream_module.html#upstream

  • 相关阅读:
    mtu
    OC2_使用系统协议
    OC1_协议语句
    Json文件/网址解析
    文件归档
    Plist文件
    NS-Date/NSDateFormatter
    OC10_文件练习
    OC9_文件操作
    OC8_NSData
  • 原文地址:https://www.cnblogs.com/boundless-sky/p/12509364.html
Copyright © 2020-2023  润新知