专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > WebSphere

Nginx对WebService分布式部署,ip_hash失效解决方法

发布时间:2010-06-14 17:20:09 文章来源:www.iduyao.cn 采编人员:星星草
Nginx对WebService分布式部署,ip_hash失效
对WebService的应用程序利用Nginx进行分布式部署,upstream 的分配方式是ip_hash,但是,不同的IP(10.5.110.92-254)请求只被分配到其中一个server上,请问是什么问题?谢谢。
nginx.conf配置:
worker_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没作用
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: