Skip to content

Apache module that replaces the original client IP address for the connection with the useragent IP address list presented by a proxy or a load balancer via the request headers.

Notifications You must be signed in to change notification settings

vgno/mod_vgremoteip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

mod_vgremoteip - Written by Ole Fredrik Skudsvik [email protected] 2013

  • Based on mod_remoteip.c

This apache module will replace the remoteip with the correct client ip address when the request is traversing through proxy / cache servers along the way before hitting apache. The proxies / caching servers needs to set an clientip header for this to work. This application will look for the X-Forwarded-For header by default unless other header is specified in configuration.

To install:

$ apxs2 -a -i -c mod_vgremoteip.c

Example of configuration: LoadModule vgremoteip_module modules/mod_vgremoteip.so

<IfModule mod_vgremoteip.c>
# Name of header which contains the 'real' client IP.
 VGRemoteIPHeader X-Forwarded-For

# Subnet to mark as trusted subnet (this ip will be allowed to set the X-Forwarded-For header and marked as a proxy ip).
# You should specify this.
VGTrustedProxy 10.1.0.0/26 

# You can also specify a single ip addresses. 
# Do not specify hostnames.
VGTrustedProxy 127.0.0.1 
</IfModule>

About

Apache module that replaces the original client IP address for the connection with the useragent IP address list presented by a proxy or a load balancer via the request headers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages