centos nginx upstream nextserver的写法一例

发布时间:2020-06-10 01:48:52 作者:朱科强
来源:网络 阅读:492

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、连接失败一次,就要等半小时后再尝试这个节点了。

推荐阅读:
  1. 基于Centos7.2的nginx部署
  2. CentOS7.2 nginx1.10.1 增加后端健康检查upstream_check模塊

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

centos nginx upstrea ce tos

上一篇:python发送邮件

下一篇:Ubuntu 12.04 安装 gearman 以及php扩展安装脚本

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》