diff --git a/templates/mod/remoteip.conf.erb b/templates/mod/remoteip.conf.erb index 0adff7110..b4518f9b0 100644 --- a/templates/mod/remoteip.conf.erb +++ b/templates/mod/remoteip.conf.erb @@ -1,21 +1,23 @@ # Declare the header field which should be parsed for useragent IP addresses RemoteIPHeader <%= @header %> +<%- if @proxy_ips -%> # Declare client intranet IP addresses trusted to present # the RemoteIPHeader value -<%- @proxy_ips.each do |proxy| -%> +<%- [@proxy_ips].flatten.each do |proxy| -%> RemoteIPInternalProxy <%= proxy %> +<%- end -%> <%- end -%> -# Declare the header field which will record all intermediate IP addresses <%- if @proxies_header -%> +# Declare the header field which will record all intermediate IP addresses RemoteIPProxiesHeader <%= @proxies_header %> <%- end -%> +<%- if @trusted_proxy_ips -%> # Declare client intranet IP addresses trusted to present # the RemoteIPHeader value -<%- if @trusted_proxy_ips -%> - <%- @trusted_proxy_ips.each do |proxy| -%> + <%- [@trusted_proxy_ips].flatten.each do |proxy| -%> RemoteIPTrustedProxy <%= proxy %> <%- end -%> <%- end -%>