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吗,可以自定义变量吗?
因为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: