我运行 Nginx 代理并想使用 GeoLite2-Country/city 数据库。我按照“https://docs.nginx.com/nginx/admin-guide/dynamic-modules/geoip2/”和“https://github.com/leev/ngx_http_geoip2_module”的说明进行操作。所以我有所需的 Nginx 模块。我还安装了 Libmaxminddb。
当我想构建我的 Docker-File 时,我收到此错误:
“MMDB_open(”/geoip/GeoLite2-City.mmdb”) 失败 - 打开 /etc/nginx/nginx.conf:17 中指定的 MaxMind DB 文件时出错”
在命令窗口中,我可以通过以下方式访问 Mmdb
$ mmdblookup --file /etc/nginx/geoip/GeoIP/GeoIP2-Country.mmdb --ip 8.8.8.8
来源:“https://github.com/leev/ngx_http_geoip2_module”
所以该文件应该是可访问的..(路径不同,因为 nginx.conf 路径从 etc/nginx 开始。
也许有人有一些想法我可以尝试或面临同样的问题?
谢谢你,来自地球的问候!
更新:我正在使用“Alpine 3.13.5”&&“Nginx-1.21.0”