Fix template mappings

This commit is contained in:
Manuel de Brito Fontes 2017-09-26 14:20:36 -03:00
parent d73edb8176
commit 6ee2b726f8
2 changed files with 3 additions and 3 deletions

View file

@ -706,5 +706,5 @@ func trustProxyProtocol(input interface{}) bool {
} }
return conf.Cfg.RealClientFrom == "tcp-proxy" || return conf.Cfg.RealClientFrom == "tcp-proxy" ||
(conf.Cfg.RealClientFrom == "auto" && !conf.Cfg.UseProxyProtocol) (conf.Cfg.RealClientFrom == "auto" && conf.Cfg.UseProxyProtocol)
} }

View file

@ -151,7 +151,7 @@ http {
'' close; '' close;
} }
{{ if (trustHTTPHeaders $cfg) }} {{ if (trustHTTPHeaders $all) }}
# Trust HTTP X-Forwarded-* Headers, but use direct values if they're missing. # Trust HTTP X-Forwarded-* Headers, but use direct values if they're missing.
map {{ buildForwardedFor $cfg.ForwardedForHeader }} $the_real_ip { map {{ buildForwardedFor $cfg.ForwardedForHeader }} $the_real_ip {
# Get IP address from X-Forwarded-For HTTP header # Get IP address from X-Forwarded-For HTTP header