Improve the session affinity feature

This commit is contained in:
Ricardo Pchevuzinske Katz 2017-02-12 21:13:39 -02:00
parent 6809319318
commit a158e5fc5a
12 changed files with 276 additions and 213 deletions

View file

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