zoukankan      html  css  js  c++  java
  • nginx *负载均衡

    1.down 表示单前的server暂时不参与负载  
    2.weight 默认为1.weight越大,负载的权重就越大。  
    3.max_fails :允许请求失败的次数默认为1.当超过最大次数时,返回proxy_next_upstream 模块定义的错误  
    4.fail_timeout:max_fails次失败后,暂停的时间。  
    5.backup: 其它所有的非backup机器down或者忙的时候,请求backup机器。所以这台机器压力会最轻。 
    
    
       upstream web_server {
             server resin1:8080 weight=10 max_fails=3 fail_timeout=2s;
             server resin2:8080 weight=10 max_fails=3 fail_timeout=2s;
             server resin3:8080 weight=10 max_fails=3 fail_timeout=2s;
             keepalive 32;
         }
    
            server {
              listen       80;
              server_name  www.xxxx.com;
      
                  
              location / {
                  proxy_next_upstream http_404 http_500 http_502 http_503 http_504 error timeout invalid_header;
                  proxy_set_header X-Real-IP $remote_addr;
                  proxy_set_header Host  $host;
                  proxy_set_header X-Forwarded-For  $remote_addr;
                  proxy_read_timeout 10s;
                  proxy_pass web_server;
             }    
         }
    
    
    
    
  • 相关阅读:
    Djano restframework
    python测试一
    SQL分类,DDL,DML,DCL
    sql查询时,根据特定的条件给表的某一个字段赋值
    数据类型之Nullable
    web.config节点
    拼凑的宿主-host
    css的优先级
    jquery——write less,do more
    double类型计算
  • 原文地址:https://www.cnblogs.com/zhenxing06/p/13299361.html
Copyright © 2011-2022 走看看