Introduce an upstream-hash-by annotation to support consistent hashing by nginx variable or text

This commit is contained in:
Lourens Naudé 2017-09-30 22:29:16 +01:00
parent 7ffa0ae265
commit d607cf6dd7
13 changed files with 166 additions and 0 deletions

View file

@ -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 }}