fix: remove unnecessary if statement when redirect annotation is defined
This commit is contained in:
parent
2cc828213d
commit
eefb32c667
1 changed files with 4 additions and 6 deletions
|
@ -1136,12 +1136,6 @@ stream {
|
|||
|
||||
{{ buildInfluxDB $location.InfluxDB }}
|
||||
|
||||
{{ if not (empty $location.Redirect.URL) }}
|
||||
if ($uri ~* {{ stripLocationModifer $path }}) {
|
||||
return {{ $location.Redirect.Code }} {{ $location.Redirect.URL }};
|
||||
}
|
||||
{{ end }}
|
||||
|
||||
{{ if isValidByteSize $location.Proxy.BodySize true }}
|
||||
client_max_body_size {{ $location.Proxy.BodySize }};
|
||||
{{ end }}
|
||||
|
@ -1267,6 +1261,10 @@ stream {
|
|||
fastcgi_param {{ $k }} {{ $v | quote }};
|
||||
{{ end }}
|
||||
|
||||
{{ if not (empty $location.Redirect.URL) }}
|
||||
return {{ $location.Redirect.Code }} {{ $location.Redirect.URL }};
|
||||
{{ end }}
|
||||
|
||||
{{ buildProxyPass $server.Hostname $all.Backends $location }}
|
||||
{{ if (or (eq $location.Proxy.ProxyRedirectFrom "default") (eq $location.Proxy.ProxyRedirectFrom "off")) }}
|
||||
proxy_redirect {{ $location.Proxy.ProxyRedirectFrom }};
|
||||
|
|
Loading…
Reference in a new issue