Use forwarded for header name from the config everywhere.

This commit is contained in:
Dario Nieuwenhuis 2017-12-26 00:19:45 +01:00
parent ef9587be9a
commit 38f0c6cc59

View file

@ -246,10 +246,10 @@ http {
# replaces the remote_addr too soon
map {{ buildForwardedFor $all.Cfg.ForwardedForHeader }} $full_x_forwarded_for {
{{ if $all.Cfg.UseProxyProtocol }}
default "$http_x_forwarded_for, $proxy_protocol_addr";
default "{{ buildForwardedFor $all.Cfg.ForwardedForHeader }}, $proxy_protocol_addr";
'' "$proxy_protocol_addr";
{{ else }}
default "$http_x_forwarded_for, $realip_remote_addr";
default "{{ buildForwardedFor $all.Cfg.ForwardedForHeader }}, $realip_remote_addr";
'' "$realip_remote_addr";
{{ end }}
}