参考文章:

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/

相关文章:

  • 2022-02-26
  • 2022-02-13
  • 2022-12-23
  • 2021-07-26
  • 2021-11-25
猜你喜欢
  • 2021-07-20
  • 2021-11-21
  • 2021-10-09
  • 2021-11-21
  • 2021-10-01
相关资源
相似解决方案