Please use this template for troubleshooting questions.
My issue:
I have run into a problem with the load order of static modules (compiled into the nginx binary using the –add-module directive). Specifically, I have found that the process initialisation call-back of my module is being called before that of the ngx_core_event module. This is problematic as my module attempts to install timers that are obliterated when the core event module performs initialisation operations.
I can correct this issue by shifting my module to be loaded dynamically.
I have also found references that suggest the initialisation order of static modules can be modified by configuration order. Are there any explicit examples of how to configure such initialisation order for static modules? I have provided my configure command below, as it is not clear how I should reorder this to ensure that my module (ngx_test_module) is ordered after the ngx_core_event module.
Version of NGINX:
nginx 1.29.1 on Ubuntu 22.04.5 LTS
Deployment environment:
$ ./configure --with-debug --with-cc-opt=‘-g -O2 -ffile-prefix-map=/build/nginx-niToSo/nginx-1.18.0=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2’ --with-ld-opt=‘-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -fPIC’ --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_sub_module –add-module=/home/rob/dev/ngx-test-module