Merge pull request #1618 from maxlaverse/fix_fullforwardedfor_with_useproxy

Fix full XFF with PROXY
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-10-28 16:24:30 -03:00 committed by GitHub
commit 2a9e1eb1cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -214,8 +214,13 @@ http {
# We can't use $proxy_add_x_forwarded_for because the realip module # We can't use $proxy_add_x_forwarded_for because the realip module
# replaces the remote_addr too soon # replaces the remote_addr too soon
map $http_x_forwarded_for $full_x_forwarded_for { map $http_x_forwarded_for $full_x_forwarded_for {
{{ if $all.Cfg.UseProxyProtocol }}
default "$http_x_forwarded_for, $proxy_protocol_addr";
'' "$proxy_protocol_addr";
{{ else }}
default "$http_x_forwarded_for, $realip_remote_addr"; default "$http_x_forwarded_for, $realip_remote_addr";
'' "$realip_remote_addr"; '' "$realip_remote_addr";
{{ end}}
} }
{{ end }} {{ end }}