view modules/apache/templates/mod/remoteip.conf.epp @ 275:d9352a684e62

Mass update of modules to remove deprecation warnings
author IBBoard <dev@ibboard.co.uk>
date Sun, 26 Jan 2020 11:36:07 +0000
parents
children b8d6ada284dd
line wrap: on
line source

<%- |
  String                                                     $header,
  Optional[Array[Variant[Stdlib::Host,Stdlib::IP::Address]]] $internal_proxy            = undef,
  Optional[Stdlib::Absolutepath]                             $internal_proxy_list       = undef,
  Optional[String]                                           $proxies_header            = undef,
  Boolean                                                    $proxy_protocol            = undef,
  Optional[Array[Stdlib::IP::Address]]                       $proxy_protocol_exceptions = undef,
  Optional[Array[Stdlib::IP::Address]]                       $trusted_proxy             = undef,
  Optional[Stdlib::Absolutepath]                             $trusted_proxy_list        = undef,
| -%>
# Declare the header field which should be parsed for useragent IP addresses
RemoteIPHeader <%= $header %>

<%- if $internal_proxy { -%>
# Declare client intranet IP addresses trusted to present
# the RemoteIPHeader value
<%-   [$internal_proxy].flatten.each |$proxy| { -%>
RemoteIPInternalProxy <%= $proxy %>
<%-   } -%>
<%- } -%>

<%- if $internal_proxy_list { -%>
RemoteIPInternalProxyList <%= $internal_proxy_list %>
<%- } -%>

<%- if $proxies_header { -%>
# Declare the header field which will record all intermediate IP addresses
RemoteIPProxiesHeader <%= $proxies_header %>
<%- } -%>

<%- if $proxy_protocol { -%>
RemoteIPProxyProtocol On
<%- } -%>

<%- if $proxy_protocol_exceptions { -%>
<%-   [$proxy_protocol_exceptions].flatten.each |$exception| { -%>
RemoteIPProxyProtocolExceptions <%= $exception %>
<%-   } -%>
<%- } -%>

<%- if $trusted_proxy { -%>
# Declare client intranet IP addresses trusted to present
# the RemoteIPHeader value
  <%- [$trusted_proxy].flatten.each |$proxy| { -%>
RemoteIPTrustedProxy <%= $proxy %>
  <%- } -%>
<%- } -%>

<%- if $trusted_proxy_list { -%>
RemoteIPTrustedProxyList <%= $trusted_proxy_list %>
<%- } -%>