diff --git a/binding/nginx/README.md b/binding/nginx/README.md index 9aa1bd090e272aeaa451886df05dfffc285f034a..de50b7d5725c38daa86a4e6431e2aca2c93face2 100644 --- a/binding/nginx/README.md +++ b/binding/nginx/README.md @@ -22,6 +22,8 @@ $ make install cache_policy: `file` or `vectorIndex` or `content`, default: `content` +Edit `nginx.conf` add `ip2region_db` directive + ```nginx ... http { @@ -50,4 +52,14 @@ http { ``` +Copy `ip2region.xdb` to `nginx/config` folder, then restart nginx, the `region` data stored in `ip2region` variable + +nginx access log sample + +```log +{"remote_addr": "127.0.0.1", "region": "0|0|0|内网IP|内网IP", "http_x_forwarded_for": ""} +{"remote_addr": "127.0.0.1", "region": "0|0|0|内网IP|内网IP", "http_x_forwarded_for": ""} + +``` + Made with ♥ by Wu Jian Ping