首页 > 其他 > 详细

centos nginx upstream nextserver的写法一例

时间:2017-07-04 23:09:47      阅读:263      评论:0      收藏:0      [点我收藏+]

http {

proxy_next_upstream error timeout http_500 http_502 http_503 http_504 http_404;

proxy_connect_timeout 60s;

proxy_read_timeout 120s;


server {


location / {

proxy_next_upstream error timeout http_502 http_404;

proxy_connect_timeout 5s;

proxy_read_timeout 8s;

proxy_pass http://portal;

}


upstream upstream {

server 1.1.1.1 max_fails=1 fail_timeout=1800s;

server 2.2.2.2 backup;

server 3.3.3.3 backup;

}


    }

}


我的理解:

1、全局可以设置一个超时时间和定义切换nextserver条件,对各个server的每个location也可以有独立的定义。

2、连接失败一次,就要等半小时后再尝试这个节点了。

centos nginx upstream nextserver的写法一例

原文:http://zhukeqiang.blog.51cto.com/8692790/1944479

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