fix: cannot set $service_name if use rewrite (#2220)
$path here is the regular expression formatted nginx location not the origin path in ingress rules. Fix https://github.com/kubernetes/ingress-nginx/issues/2131
This commit is contained in:
parent
e1c7892e4a
commit
0b0a274a9a
2 changed files with 2 additions and 2 deletions
File diff suppressed because one or more lines are too long
|
@ -794,7 +794,7 @@ stream {
|
||||||
|
|
||||||
set $proxy_upstream_name "{{ buildUpstreamName $server.Hostname $all.Backends $location }}";
|
set $proxy_upstream_name "{{ buildUpstreamName $server.Hostname $all.Backends $location }}";
|
||||||
|
|
||||||
{{ $ing := (getIngressInformation $location.Ingress $path) }}
|
{{ $ing := (getIngressInformation $location.Ingress $location.Path) }}
|
||||||
{{/* $ing.Metadata contains the Ingress metadata */}}
|
{{/* $ing.Metadata contains the Ingress metadata */}}
|
||||||
set $namespace "{{ $ing.Namespace }}";
|
set $namespace "{{ $ing.Namespace }}";
|
||||||
set $ingress_name "{{ $ing.Rule }}";
|
set $ingress_name "{{ $ing.Rule }}";
|
||||||
|
|
Loading…
Reference in a new issue