Nginx_upstream

发布时间:2020-07-24 21:36:09 作者:乱世浮尘
来源:网络 阅读:527

Nginx_upstream 负载均衡&高可用

负载均衡调度算法:

upstream duanserver {
    server 192.168.4.41:80 weight=1 max_fails=3 fail_timeout=10s;
    server 192.168.4.42:80 weight=2 max_fails=3 fail_timeout=10s;
}

server {
    listen       80;
    server_name  www.xxx.com;
    root         /usr/local/nginx/html;
    
    location / {
        root   html;
        index  index.html index.htm;
        proxy_pass  http://duanserver;
        #后端服务出现以下错误情况,实现故障转移(可自动切走 & 切回);
        proxy_next_upstream http_403 http_404 http_500 http_502 http_503 error timeout invalid_header;
        include     /usr/local/nginx/conf/proxy.conf;
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
}


Any question, please contact me!

推荐阅读:
  1. nginx是什么
  2. Nginx启用压缩及开启gzip 压缩的方法

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

nginx upstream st

上一篇:面向对象概念

下一篇:使用python管理服务器

相关阅读

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

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