Introduce an upstream-hash-by annotation to support consistent hashing by nginx variable or text
This commit is contained in:
parent
7ffa0ae265
commit
d607cf6dd7
13 changed files with 166 additions and 0 deletions
|
|
@ -271,6 +271,10 @@ http {
|
|||
{{ $cfg.LoadBalanceAlgorithm }};
|
||||
{{ end }}
|
||||
|
||||
{{ if $upstream.UpstreamHashBy }}
|
||||
hash {{ $upstream.UpstreamHashBy }} consistent;
|
||||
{{ end }}
|
||||
|
||||
{{ if (gt $cfg.UpstreamKeepaliveConnections 0) }}
|
||||
keepalive {{ $cfg.UpstreamKeepaliveConnections }};
|
||||
{{ end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue