# cd /usr/ports/net/GeoIP && make install clean
Checking nginx for geoip module:
# nginx -V | grep "--with-http_geoip_module"
Downloading MaxMind Geo database:
# cd /usr/local/etc/nginx
# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
# gzip -cd GeoIP.dat.gz > GeoIP.dat
Enabling GeoIP module at nginx.conf:
http {
geoip_country /usr/local/etc/nginx/GeoIP.dat;
...
Adding fastcgi_params for provide GEOIP variable to fast-cgi server:
fastcgi_param GEOIP_COUNTRY_CODE $geoip_city_country_code;
# /usr/local/etc/rc.d/nginx reload
MANs:
http://sysoev.ru/nginx/docs/http/ngx_http_geoip_module.html
http://www.maxmind.com/app/c
http://www.maxmind.com/app/geolitecountry
--
FreeBSDer
No comments:
Post a Comment