Merge pull request #258 from rikatz/nginx-sticky-annotations

Nginx sticky annotations
This commit is contained in:
Prashanth B 2017-02-17 05:27:18 +05:30 committed by GitHub
commit 698c08402a
10 changed files with 406 additions and 10 deletions

View file

@ -185,8 +185,8 @@ http {
{{range $name, $upstream := $backends}}
upstream {{$upstream.Name}} {
{{ if $cfg.EnableStickySessions }}
sticky hash=sha1 httponly;
{{ if eq $upstream.SessionAffinity.AffinityType "cookie" }}
sticky hash={{$upstream.SessionAffinity.CookieSessionAffinity.Hash}} name={{$upstream.SessionAffinity.CookieSessionAffinity.Name}} httponly;
{{ else }}
least_conn;
{{ end }}