Skip to content

Commit

Permalink
Merge pull request #1128 from dgarbus/geoip_scanproxyheaderfield
Browse files Browse the repository at this point in the history
Add the ability to specify GeoIPScanProxyHeaderField for mod_geoip
  • Loading branch information
jonnytdevops committed Jun 18, 2015
2 parents 4c5e171 + f71a8de commit 3d23958
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
40 changes: 35 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -666,14 +666,44 @@ These are the default settings:

```puppet
class {'apache::mod::geoip':
$enable => false,
$db_file => '/usr/share/GeoIP/GeoIP.dat',
$flag => 'Standard',
$output => 'All',
enable => false,
db_file => '/usr/share/GeoIP/GeoIP.dat',
flag => 'Standard',
output => 'All',
}
```

The parameter `db_file` can be a single directory or a hash of directories.
#####`enable`

Boolean. Enable or Disable mod_geoip globally. Defaults to false.

#####`db_file`

The full path to your GeoIP database file. Defaults to `/usr/share/GeoIP/GeoIP.dat`. This parameter optionally takes an array of paths for multiple GeoIP database files.

#####`flag`

GeoIP Flag. Defaults to 'Standard'.

#####`output`

Defines which output variables to use. Defaults to 'All'.

#####`enable_utf8`

Boolean. Changes the output from ISO-8859-1 (Latin-1) to UTF-8.

#####`scan_proxy_headers`

Boolean. Enables the GeoIPScanProxyHeaders option. More information can be found [here](http://dev.maxmind.com/geoip/legacy/mod_geoip2/#Proxy-Related_Directives).

#####`scan_proxy_header_field`

Specifies which header that mod_geoip should look at to determine the client's IP address.

#####`use_last_xforwarededfor_ip`

Boolean. If a comma-separated list of IP addresses is found, use the last IP address for the client's IP.

####Class: `apache::mod::info`

Expand Down
2 changes: 2 additions & 0 deletions manifests/mod/geoip.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
$output = 'All',
$enable_utf8 = undef,
$scan_proxy_headers = undef,
$scan_proxy_header_field = undef,
$use_last_xforwarededfor_ip = undef,
) {
::apache::mod { 'geoip': }
Expand All @@ -16,6 +17,7 @@
# - output
# - enable_utf8
# - scan_proxy_headers
# - scan_proxy_header_field
# - use_last_xforwarededfor_ip
file { 'geoip.conf':
ensure => file,
Expand Down
3 changes: 3 additions & 0 deletions templates/mod/geoip.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ GeoIPEnableUTF8 <%= scope.function_bool2httpd([@enable_utf8]) %>
<% if ! @scan_proxy_headers.nil? -%>
GeoIPScanProxyHeaders <%= scope.function_bool2httpd([@scan_proxy_headers]) %>
<% end -%>
<% if ! @scan_proxy_header_field.nil? -%>
GeoIPScanProxyHeaderField <%= @scan_proxy_header_field %>
<% end -%>
<% if ! @use_last_xforwarededfor_ip.nil? -%>
GeoIPUseLastXForwardedForIP <%= scope.function_bool2httpd([@use_last_xforwarededfor_ip]) %>
<% end -%>
Expand Down

0 comments on commit 3d23958

Please sign in to comment.