leev / ngx_http_geoip2_module

Nginx GeoIP2 module
BSD 2-Clause "Simplified" License
983 stars 186 forks source link

Leak in documentation #60

Closed kamil-michalak closed 4 years ago

kamil-michalak commented 6 years ago

Hi, you don't mention about configurations options:

One thing this option will not work if we use source param

Allen-yan commented 4 years ago

How to use this options?

Allen-yan commented 4 years ago

mine nginx config, that's work.

` http{ ...... geoip2_proxy 172.0.0.0/8; geoip2_proxy 10.0.0.0/8; geoip2_proxy 198.162.0.0/16; geoip2_proxy_recursive on;

   geoip2 /data/GeoLite2-Country.mmdb {
            auto_reload 120m;

            $metadata_country_build metadata build_epoch;
            $geoip2_country_code default=CN source=$remote_addr country iso_code;
            $geoip2_country_name default="China" source=$remote_addr country names en;
 }

   server {
       listen  80;
       location /geoip {
               default_type text/plain;
               return 200 '{"client_ip":"$remote_addr",        

"country_name":"$geoip2_country_name","country_code":"$geoip2_country_code"}'; } } } `