Skip to content

Commit

Permalink
When upstream-hash-by annotation is used do not configure a lb algori…
Browse files Browse the repository at this point in the history
…thm (#1858)
  • Loading branch information
aledbf authored Dec 27, 2017
1 parent 85d97df commit 54cfad0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions rootfs/etc/nginx/template/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,11 @@ http {


upstream {{ $upstream.Name }} {
# Load balance algorithm; empty for round robin, which is the default
{{ if ne $cfg.LoadBalanceAlgorithm "round_robin" }}
{{ $cfg.LoadBalanceAlgorithm }};
{{ end }}

{{ if $upstream.UpstreamHashBy }}
hash {{ $upstream.UpstreamHashBy }} consistent;
{{ else }}
# Load balance algorithm; empty for round robin, which is the default
{{ if ne $cfg.LoadBalanceAlgorithm "round_robin" }}{{ $cfg.LoadBalanceAlgorithm }};{{ end }}
{{ end }}

{{ if (gt $cfg.UpstreamKeepaliveConnections 0) }}
Expand Down

0 comments on commit 54cfad0

Please sign in to comment.