Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

Fork of MaxMind's mod_geoip2 with better X-Forwarded-For handling

Notifications You must be signed in to change notification settings

rvagg/archived-mod_geoip2_xff.old

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mod_geoip2_xff

mod_geoip2 with fancy, new-fangled X-Forwarded-For handling

A fork of MaxMind's mod_geoip2 with more intelligent X-Forwarded-For handling, as per this post.

Currently based on mod_geoip2_1.2.7

Summary: The client-IP address in the list of addresses potentially in the X-Forwarded-For HTTP header is normally the left-most header but clients with private IP addresses using a forwarding proxy mean that you'll often get the wrong address, usually a private IP address. This module follows the rule:

Always use the leftmost non-private address.

You can compare with the current MaxMind release here.

To enable this special mode you need to turn the GeoIPUseLeftPublicXForwardedForIP flag On in your apache config.

An additional config option is also available: GeoIPEnableHostnameLookups, when set to On mod_geoip2 will attempt to resolve the matched IP address and store the result in the GEOIP_HOST environment variable. This is useful for logging or other basic remote host based configuration.

Changes for this fork are being recorded in the Changes file.

Contributions more than welcome!

Thanks to Kevin Gaudin for his contributions to fall back to the RemoteIP where we fail to find a public IP address match.

Original MaxMind README is here.

Follow the same instructions found in the original INSTALL.

See Downloads for tarballs.

About

Fork of MaxMind's mod_geoip2 with better X-Forwarded-For handling

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published