首页 > 其他 > 详细

nginx ip_hash负载

时间:2015-06-23 13:47:26      阅读:116      评论:0      收藏:0      [点我收藏+]

nginx.config       server_names_hash_bucket_size 64;

    upstream 192.168.0.40 {

        ip_hash;

        server 192.168.0.55 max_fails=3 fail_timeout=20s weight=9;
        server 192.168.0.56 max_fails=3 fail_timeout=20s weight=7;
        server 192.168.0.57 max_fails=3 fail_timeout=20s weight=5;
        server 192.168.0.58 max_fails=3 fail_timeout=20s weight=3;
    }
    server {
        listen 80;
        server_name 192.168.0.40;
        location / {
            proxy_pass http://192.168.0.40;
            proxy_set_header Host $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        }
        access_log  logs/access.log  main;
    }


本文出自 “WEBLOFT” 博客,请务必保留此出处http://webloft.blog.51cto.com/9067902/1664288

nginx ip_hash负载

原文:http://webloft.blog.51cto.com/9067902/1664288

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!