Merge pull request #4958 from niedbalski/fix-forwarded-proto
Add a forwarded protocol map for included x-forwarded-proto.
This commit is contained in:
commit
d5d1e9bfbd
1 changed files with 7 additions and 0 deletions
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue