首页 > Web开发 > 详细

nginx负载均衡策略url_hash配置方法

时间:2019-07-05 21:42:51      阅读:648      评论:0      收藏:0      [点我收藏+]

参考文章:

https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/
根据路径,进行一致性hash,具体的配置方法

upstream backend {
    hash $request_uri consistent;
    server backend1.example.com;
    server backend2.example.com;
}

需要注意的是:顺序不能错,否则会报错

nginx: [warn] load balancing method redefined in /etc/nginx/conf.d/upstream.conf:5

https://ma.ttias.be/nginx-nginx-warn-load-balancing-method-redefined/

nginx负载均衡策略url_hash配置方法

原文:https://www.cnblogs.com/victor2302/p/11140755.html

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