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:
Oilbeater 2018-03-22 20:43:45 +08:00 committed by Manuel Alejandro de Brito Fontes
parent e1c7892e4a
commit 0b0a274a9a
2 changed files with 2 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -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 }}";