Skip to content

saifulmr/nginx-geoip2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

NGINX open source with geoip2 module support

Add the following in your nginx configuration either in http context or stream context. Then use $geoip_country_code & $geoip_city_code as variables.

geoip2 /etc/nginx/geoip/GeoLite2-Country.mmdb {
   $geoip_country_code default=UnknownCountry source=$remote_addr country iso_code;
}

geoip2 /etc/nginx/geoip/GeoLite2-City.mmdb {
   $geoip_city_code default=UnknownCity city names en;
}

License

Database & Contents Copyright (C) Maxmind, Inc.

About

NGINX Open Source with geoip2 module support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published