diff --git a/pkg/compute/models/loadbalanceragents_deploy.go b/pkg/compute/models/loadbalanceragents_deploy.go index 3083bc117c..b5b0180256 100644 --- a/pkg/compute/models/loadbalanceragents_deploy.go +++ b/pkg/compute/models/loadbalanceragents_deploy.go @@ -436,6 +436,7 @@ auth_uri = '{{ auth_uri }}' admin_user = '{{ user }}' admin_password = '{{ pass }}' admin_tenant_name = '{{ proj }}' +session_endpoint_type = 'public' data_preserve_n = 10 base_data_dir = "/opt/cloud/workspace/lbagent" diff --git a/pkg/lbagent/models/haproxy.go b/pkg/lbagent/models/haproxy.go index 1227eaf8d2..492ddac11c 100644 --- a/pkg/lbagent/models/haproxy.go +++ b/pkg/lbagent/models/haproxy.go @@ -285,14 +285,18 @@ func (b *LoadbalancerCorpus) genHaproxyConfigBackend(data map[string]interface{} stickyCookie := "" switch listener.StickySessionType { case "insert": - stickyCookie = "cookie SERVERID insert indirect nocache" + cookie := listener.StickySessionCookie + if cookie == "" { + cookie = "SERVERID" + } + stickyCookie = fmt.Sprintf("cookie %s insert indirect nocache", cookie) if maxIdle := listener.StickySessionCookieTimeout; maxIdle > 0 { stickyCookie += fmt.Sprintf(" maxidle %ds", maxIdle) } case "server": cookie := listener.StickySessionCookie if cookie != "" { - stickyCookie = fmt.Sprintf("cookie %q rewrite nocache", cookie) + stickyCookie = fmt.Sprintf("cookie %q rewrite", cookie) } } if stickyCookie != "" {