We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
尝试把模块编译进 nginx 了,目前的配置: main 块:
load_module modules/ngx_ip2region_module.so; ip2region_db_file /path/to/ip2region.db; ip2region_algo btree;
目前想把解析 ip 记录到access log,类似 https://github.com/ip2location/ip2location-nginx/blob/master/README.md#variables 看了下源码,貌似没有找到相关的变量值,可否增加一下呢,谢谢!
The text was updated successfully, but these errors were encountered:
你可以描述一下具体需要哪些?看库里面是否有变量可以导出
Sorry, something went wrong.
现在用的 ngx_http_geoip2_module 这个模块,用了其中两个变量,一个是记录 ip 的国家,一个是 ip 的城市,便于用 grafana 统计展示访问来源
http 配置如下
log_format acess-log escape=json ... '"geoip2_data_country_code": "$geoip2_data_country_code",' '"geoip2_data_city_name": "$geoip2_data_city_name"' ...
日志样例:
"geoip2_data_country_code": "CN","geoip2_data_city_name": "Guangzhou"
ip2region 的数据相对准确,因此想使用这个模块给 nginx 解析 ip 来源,记录到日志文件,达到上面的结果
No branches or pull requests
尝试把模块编译进 nginx 了,目前的配置:
main 块:
目前想把解析 ip 记录到access log,类似 https://github.com/ip2location/ip2location-nginx/blob/master/README.md#variables
看了下源码,貌似没有找到相关的变量值,可否增加一下呢,谢谢!
The text was updated successfully, but these errors were encountered: