From e39fdd7bf8fac13dd7abcdad706f40528ca4b326 Mon Sep 17 00:00:00 2001 From: Lee Date: Thu, 3 Nov 2016 23:48:10 +0000 Subject: [PATCH] Update README.md --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9aef1c7..31f4484 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ Description =========== -**ngx_http_geoip2_module** - creates variables with values from the maxmind geoip2 databases based on the client IP (supports both IPv4 and IPv6) +**ngx_http_geoip2_module** - creates variables with values from the maxmind geoip2 databases based on the client IP (default) or from a specific variable (supports both IPv4 and IPv6) + +The module now supports nginx streams and can be used in the same way the http module can be used. ## Installing First install [libmaxminddb](https://github.com/maxmind/libmaxminddb) as described in its [README.md @@ -60,6 +62,14 @@ http { fastcgi_param CITY_NAME $geoip2_data_city_name; .... } + +stream { + ... + geoip2 /etc/maxmind-country.mmdb { + $geoip2_data_country_code default=US source=$remote_addr country iso_code; + } + ... +} ``` To find the path of the data you want (eg: city names en), use the [mmdblookup tool](https://maxmind.github.io/libmaxminddb/mmdblookup.html):