Add sticky path
This commit is contained in:
parent
2d6f811151
commit
df4082256a
1 changed files with 2 additions and 1 deletions
|
@ -253,7 +253,7 @@ http {
|
||||||
{{ range $name, $upstream := $backends }}
|
{{ range $name, $upstream := $backends }}
|
||||||
{{ if eq $upstream.SessionAffinity.AffinityType "cookie" }}
|
{{ if eq $upstream.SessionAffinity.AffinityType "cookie" }}
|
||||||
upstream sticky-{{ $upstream.Name }} {
|
upstream sticky-{{ $upstream.Name }} {
|
||||||
sticky hash={{ $upstream.SessionAffinity.CookieSessionAffinity.Hash }} name={{ $upstream.SessionAffinity.CookieSessionAffinity.Name }} httponly;
|
sticky hash={{ $upstream.SessionAffinity.CookieSessionAffinity.Hash }} name={{ $upstream.SessionAffinity.CookieSessionAffinity.Name }} path=$base_path httponly;
|
||||||
|
|
||||||
{{ if (gt $cfg.UpstreamKeepaliveConnections 0) }}
|
{{ if (gt $cfg.UpstreamKeepaliveConnections 0) }}
|
||||||
keepalive {{ $cfg.UpstreamKeepaliveConnections }};
|
keepalive {{ $cfg.UpstreamKeepaliveConnections }};
|
||||||
|
@ -672,6 +672,7 @@ stream {
|
||||||
set $namespace "{{ $ing.Namespace }}";
|
set $namespace "{{ $ing.Namespace }}";
|
||||||
set $ingress_name "{{ $ing.Rule }}";
|
set $ingress_name "{{ $ing.Rule }}";
|
||||||
set $service_name "{{ $ing.Service }}";
|
set $service_name "{{ $ing.Service }}";
|
||||||
|
set $base_path "{{ $location.Path }}";
|
||||||
|
|
||||||
{{ if (or $location.Rewrite.ForceSSLRedirect (and (not (empty $server.SSLCertificate)) $location.Rewrite.SSLRedirect)) }}
|
{{ if (or $location.Rewrite.ForceSSLRedirect (and (not (empty $server.SSLCertificate)) $location.Rewrite.SSLRedirect)) }}
|
||||||
# enforce ssl on server side
|
# enforce ssl on server side
|
||||||
|
|
Loading…
Reference in a new issue