Skip to content

Unable to use load_module #2642

@frnzhop

Description

@frnzhop

Hi,

I need to include the geoip2 module.

I've tried to place it in /etc/nginx/geoip.conf like this

load_module modules/ngx_http_geoip2_module.so;
load_module modules/ngx_stream_geoip2_module.so;

geoip_country /etc/nginx/GeoLite2-Country.mmdb {
  $geoip_country_code default=US source=$remote_addr country iso_code;
}

However, I get this error:

frontend-nginx-proxy  | forego      | starting nginx.1 on port 32200
frontend-nginx-proxy  | nginx.1     | nginx: [emerg] "load_module" directive is not allowed here in /etc/nginx/conf.d/geoip.conf:1

There's this other issue on this topic which was never resolved: #1535

Thank you for the help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions