From 687df1469f7f4eb21a58dcaeb9bf040870060e9b Mon Sep 17 00:00:00 2001
From: Luca Toscano RemoteIPHeader
directive.
Additionally, this module implements the server side of
+ HAProxy's
+ Proxy Protocol when
+ using the RemoteIPProxyProtocolEnable
+ directive.
Once replaced as instructed, this overridden useragent IP address is
then used for the mod_authz_host
Require ip
@@ -69,6 +75,7 @@ via the request headers.
mod_authz_host
mod_status
mod_log_config
Description: | Enable, optionally enable or disable the proxy protocol handling |
---|---|
Syntax: | ProxyProtocol On|Optional|Off |
Context: | server config, virtual host |
Status: | Base |
Module: | mod_remoteip |
The RemoteIPProxyProtocolEnable
enables or
+ disables the reading and handling of the proxy protocol connection header.
+ If enabled with the On
flag, the upstream client must
+ send the header every time it opens a connection or the connection will
+ be aborted. If enabled with the Optional
flag, the upstream
+ client may send the header.
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 any one of + them, then it is enabled for all 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.
+ +On
and Optional
+ flags, connections will not be aborted if the header is not sent.
+ Instead, enforcement will happen after the request is read so virtual
+ hosts configured with On
will return a 400 Bad Request.
+ Virtual hosts configured with Optional
will continue as
+ usual but without replacing the client IP informationListen 80 +<VirtualHost *:80> + ServerName www.example.com + RemoteIPProxyProtocolEnable Optional + + #Requests to this virtual host may optionally not have + # a proxy protocol header provided +</VirtualHost> + +<VirtualHost *:80> + ServerName www.example.com + RemoteIPProxyProtocolEnable On + + #Requests to this virtual host must have a proxy protocol + # header provided. If it is missing, a 400 will result +</VirtualHost> + +Listen 8080 +<VirtualHost *:8080> + ServerName www.example.com + RemoteIPProxyProtocolEnable On + + #Requests to this virtual host must have a proxy protocol + # header provided. If it is missing, the connection will + # be aborted +</VirtualHost>+ +