leev / ngx_http_geoip2_module

Nginx GeoIP2 module
BSD 2-Clause "Simplified" License
983 stars 186 forks source link

stream block: geoip2 directive is not allowed here #129

Closed arren-ru closed 7 months ago

arren-ru commented 7 months ago

Discovered error in configuration:

2024/05/01 03:47:23 [emerg] 167061#167061: "geoip2" directive is not allowed here in /etc/nginx/nginx.conf:97

by using geoip2 directive in stream block according to readme

load_module /usr/lib/nginx/modules/ngx_http_geoip2_module.so;

stream {
    geoip2 /usr/share/GeoIP/GeoLite2-Country.mmdb {
        $geo_country_code country iso_code;
        $geo_country_name country names en;
    }
}

nginx 1.26.0 module has been built right from master, previously get the same error on packaged version 3.4

arren-ru commented 7 months ago

my bad, lose --with-stream flag before building