mirror of
https://github.com/wahyd4/ingress-nginx.git
synced 2026-08-09 05:16:27 +10:00
Merge pull request #4958 from niedbalski/fix-forwarded-proto
Add a forwarded protocol map for included x-forwarded-proto.
This commit is contained in:
@@ -323,6 +323,12 @@ http {
|
||||
'' "$realip_remote_addr";
|
||||
{{ end}}
|
||||
}
|
||||
|
||||
map $http_x_forwarded_proto $full_x_forwarded_proto {
|
||||
default $http_x_forwarded_proto;
|
||||
"" $scheme;
|
||||
}
|
||||
|
||||
{{ end }}
|
||||
|
||||
# Create a variable that contains the literal $ character.
|
||||
@@ -1132,6 +1138,7 @@ stream {
|
||||
{{ $proxySetHeader }} X-Real-IP $remote_addr;
|
||||
{{ if and $all.Cfg.UseForwardedHeaders $all.Cfg.ComputeFullForwardedFor }}
|
||||
{{ $proxySetHeader }} X-Forwarded-For $full_x_forwarded_for;
|
||||
{{ $proxySetHeader }} X-Forwarded-Proto $full_x_forwarded_proto;
|
||||
{{ else }}
|
||||
{{ $proxySetHeader }} X-Forwarded-For $remote_addr;
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user