Skip to content

Commit

Permalink
Adding some geoip variables and default values (kubernetes#8159)
Browse files Browse the repository at this point in the history
* adding geoIp variables that Shopify uses

* adding source remote_addr for geoip2-isp
  • Loading branch information
anaclaudiar authored and rchshld committed May 17, 2023
1 parent 8248630 commit b003172
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions rootfs/etc/nginx/template/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,9 @@ http {

{{ if eq $file "GeoIP2-ISP.mmdb" }}
geoip2 /etc/nginx/geoip/GeoIP2-ISP.mmdb {
$geoip2_isp isp;
$geoip2_isp_org organization;
$geoip2_isp source=$remote_addr isp;
$geoip2_isp_org source=$remote_addr organization;
$geoip2_asn source=$remote_addr default=0 autonomous_system_number;
}
{{ end }}

Expand All @@ -259,8 +260,11 @@ http {
{{ if eq $file "GeoIP2-Anonymous-IP.mmdb" }}
geoip2 /etc/nginx/geoip/GeoIP2-Anonymous-IP.mmdb {
$geoip2_is_anon source=$remote_addr is_anonymous;
$geoip2_is_hosting_provider source=$remote_addr is_hosting_provider;
$geoip2_is_public_proxy source=$remote_addr is_public_proxy;
$geoip2_is_anonymous source=$remote_addr default=0 is_anonymous;
$geoip2_is_anonymous_vpn source=$remote_addr default=0 is_anonymous_vpn;
$geoip2_is_hosting_provider source=$remote_addr default=0 is_hosting_provider;
$geoip2_is_public_proxy source=$remote_addr default=0 is_public_proxy;
$geoip2_is_tor_exit_node source=$remote_addr default=0 is_tor_exit_node;
}
{{ end }}

Expand Down

0 comments on commit b003172

Please sign in to comment.