毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> 企业开发 >> 正文

Nginx对WebService分布式部署,ip_hash失效

更新时间:2012-9-1:  来源:毕业论文

对WebService的应用程序利用Nginx进行分布式部署,upstream 的分配方式是ip_hash,但是,不同的IP(10.5.110.92-254)请求只被分配到其中一个server上,请问是什么问题?谢谢。
nginx.conf配置:
XML codeworker_processes  1;
error_log  logs/error.log  info;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       8777;
        server_name  localhost;
        access_log  logs/host.access.log;
        location / {
            root   html;
            index  index.html index.htm;
            proxy_redirect off;
            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_pass http://localhost;           
        }
    }
    upstream localhost {
        ip_hash;
        server 127.0.0.1:18777;
        server 127.0.0.1:28777;
    }
}

The key for the hash is the class-C network address of the client
我也遇到这个问题,感觉IP_HASH没作用

ufwt说:因为ip hash是对ip的前3个字段做hash的

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。