问题描述
- nginx负载均衡配置,hash后面的参数
-
upstream redis {
hash $hash_img_url;
server 192.168.84.69:6379;
server 192.168.84.69:6380;
server 192.168.84.69:6381;
keepalive 512;
}
这个hash的变量只能是访问的url吗,可以自定义变量吗?
解决方案
nginx 负载均衡配置
nginx 负载均衡的配置
nginx 负载均衡配置
解决方案二:
因为i一般都是通过URL来做负载均衡,你想用其他的当然也可以。
The generic hash method: the server to which a request is sent is determined from a user-defined key which may be a text, variable, or their combination. For example, the key may be a source IP and port, or URI:
时间: 2025-01-01 16:12:59