This module is used to treat the useragent which initiated the request as the originating useragent as identified by httpd for the purposes of authorization and logging, even where that useragent is behind a load balancer, front end server, or proxy server.
The module overrides the client IP address for the connection
with the useragent IP address reported in the request header configured
with the
Additionally, this module implements the server side of
HAProxy's
PROXY Protocol when
using the
Once replaced as instructed, this overridden useragent IP address is
then used for the %a
and %a
format strings. The underlying client IP of the connection
is available in the %{c}a
format string.
Apache by default identifies the useragent with the connection's client_ip value, and the connection remote_host and remote_logname are derived from this value. These fields play a role in authentication, authorization and logging and other purposes by other loadable modules.
mod_remoteip overrides the client IP of the connection with the advertised useragent IP as provided by a proxy or load balancer, for the duration of the request. A load balancer might establish a long lived keepalive connection with the server, and each request will have the correct useragent IP, even though the underlying client IP address of the load balancer remains unchanged.
When multiple, comma delimited useragent IP addresses are listed in the header value, they are processed in Right-to-Left order. Processing halts when a given useragent IP address is not trusted to present the preceding IP address. The header field is updated to this remaining list of unconfirmed IP addresses, or if all IP addresses were trusted, this header is removed from the request altogether.
In overriding the client IP, the module stores the list of intermediate
hosts in a remoteip-proxy-ip-list note, which %{remoteip-proxy-ip-list}n
format token.
If the administrator needs to store this as an additional header, this
same value can also be recording as a header using the directive
The
The
The
The '#
' hash character designates a comment line, otherwise
each whitespace or newline separated entry is processed identically to
the
# Our internally trusted proxies; 10.0.2.0/24 #Everyone in the testing group gateway.localdomain #The front end balancer
The
The On
flag, the upstream client must
send the header every time it opens a connection or the connection will
be aborted unless it is in the list of disabled hosts provided by the
While this directive may be specified in any virtual host, it is important to understand that because the PROXY protocol is connection based and protocol agnostic, the enabling and disabling is actually based on IP address and port. This means that if you have multiple name-based virtual hosts for the same host and port, and you enable it for any one of them, then it is enabled for all of them (with that host and port). It also means that if you attempt to enable the PROXY protocol in one and disable in the other, that won't work; in such a case, the last one wins and a notice will be logged indicating which setting was being overridden.
The
The
Unlike the
The
The '#
' hash character designates a comment line, otherwise
each whitespace or newline separated entry is processed identically to
the