You are not logged in.

#1 2025-09-19 14:39:21

AtmIgn
Member
Registered: 2024-12-18
Posts: 15

[SOLVED] NGINX doesn't start when GeoIP module is loaded

Hi,

I'm trying to set up monitoring for my NGINX reverse proxy, but I've run into an issue with setting up GeoIP. I downloaded the necessary packages:

geoip geoip-database geoip-database-extra nginx-mod-geoip

then followed the NGINX documentation for setting this up. But when the NGINX tries to load the module, the systemd service suddenly won't start, with the following line in the logs:

nginx[277713]: 2025/09/19 10:15:17 [emerg] 277713#277713: dlopen() "/usr/lib/nginx/modules/ngx_stream_geoip_module.so" failed (/usr/lib/nginx/modules/ngx_stream_geoip_module.so: undefined symbol:  ngx_stream_add_variable) in /etc/nginx/modules.d/20-geoip.conf:2

All this happens without any geoip features enabled in /etc/nginx/nginx.conf

The config file mentioned in the error message /etc/nginx/modules.d/20-geoip.conf only has two lines:

load_module "/usr/lib/nginx/modules/ngx_http_geoip_module.so";
load_module "/usr/lib/nginx/modules/ngx_stream_geoip_module.so";

I have verified that the two shared object files actually are where the config expects them to be. The only way I could get NGINX running again is by commenting both lines out.
Running

# nginx -t

throws the same error message (unless both GeoIP modules are disabled)

2025/09/19 10:34:24 [emerg] 281671#281671: dlopen() "/usr/lib/nginx/modules/ngx_stream_geoip_module.so" failed (/usr/lib/nginx/modules/ngx_stream_geoip_module.so: undefined symbol: ngx_stream_add_variable) in /etc/nginx/modules.d/20-geoip.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failed

I don't have any idea how to begin troubleshooting this, or where the problem could lie.

Any help is greatly appreciated.

Last edited by AtmIgn (2025-09-19 17:15:50)

Offline

#2 2025-09-19 15:01:19

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,381

Re: [SOLVED] NGINX doesn't start when GeoIP module is loaded

See https://github.com/oerdnj/deb.sury.org/ … -734722970. Do you have 50-mod-stream.conf configured?

Offline

#3 2025-09-19 17:15:28

AtmIgn
Member
Registered: 2024-12-18
Posts: 15

Re: [SOLVED] NGINX doesn't start when GeoIP module is loaded

Thank you for the quick help. All I needed to do was install

nginx-mod-stream

Offline

Board footer

Powered by FluxBB