winqing 发表于 2017-9-4 07:17:57

aboutyj 发表于 2017-9-4 12:50:21

[*]upstream HA {
[*]server AIP:port weight=10 max_fails=3 fail_timeout=5s;
[*]server BIP:port weight=10 max_fails=3 fail_timeout=5s;
[*]server CIP:port weight=10 max_fails=3 fail_timeout=5s;
[*]server DIP:port weight=10 max_fails=3 fail_timeout=5s;
[*]server EIP:port weight=10 max_fails=3 fail_timeout=5s;
[*]}
[*]
[*]server {
[*]    listen port;
[*]    server_name yourdomain.com;
[*]    ...
[*]    location ~ \.*$ {
[*]      proxy_pass http(s)://HA;
[*]      ...
[*]    }
[*]    ...
[*]}复制代码

wangcan45 发表于 2017-9-4 10:44:49

本帖最后由 wangcan45 于 2017-9-4 10:57 编辑

nginx里有个weight 参数 可以设置权重 你都设成一样的权重肯定不会负载更多

pfdiy 发表于 2017-9-4 11:01:17

楼上正确答案
页: [1]
查看完整版本: 请教大神nginx负载问题