bukaleyang / zhongkui-waf

WAF based on lua-nginx-module.
Apache License 2.0
164 stars 38 forks source link

geoip开启后报错 #27

Closed duzhor closed 1 year ago

duzhor commented 1 year ago

已从官网注册下载GeoLite2-City.mmdb,配置为:

    -- 开启ip地理位置识别
    geoip = "off",
    -- geoip数据文件路径
   geoip_db_file = "/usr/local/share/GeoIP/GeoLite2-City.mmdb",
    -- 允许哪些国家的ip请求,其值为大写的ISO国家代码,如CN,如果设置为空值则允许所有
    geoip_allow_country = {"CN"},
    -- geoip显示语言,默认中文
    geoip_language = "zh-CN",

重启openresty后访问报500,日志报错:

[error] 27933#27933: *89 [lua] geoip.lua:30: lookup(): failed to lookup by ip,reason:not initialized, client: 
duzhor commented 1 year ago

版本是刚拉的master,改用v0.2.3版本正常

bukaleyang commented 1 year ago

应该是你哪里没配置对,改完配置要重启。

bukaleyang commented 1 year ago

今天发现确实是有bug,已经修复。