Fallback to ngx.var.scheme for redirectScheme with use-forward-headers when X-Forwarded-Proto is empty (#8468)
This commit is contained in:
parent
e86e7eebf5
commit
db4aeea723
1 changed files with 6 additions and 1 deletions
|
@ -591,7 +591,12 @@ http {
|
|||
end
|
||||
|
||||
{{ if $cfg.UseForwardedHeaders }}
|
||||
local redirectScheme = ngx.var.http_x_forwarded_proto
|
||||
local redirectScheme
|
||||
if not ngx.var.http_x_forwarded_proto then
|
||||
redirectScheme = ngx.var.scheme
|
||||
else
|
||||
redirectScheme = ngx.var.http_x_forwarded_proto
|
||||
end
|
||||
{{ else }}
|
||||
local redirectScheme = ngx.var.scheme
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in a new issue