Dynamic module and obtaining http core module configuration

Rūdolfs Bundulis rudolfs.bundulis at gmail.com
Wed Aug 10 09:09:54 UTC 2016


Hi,

I am trying to make a dynamic nginx module. After reading all the tutorials
and stuff available I set up a working minimal sample and started hooking
up my http handlers. The question that arose is, in the static modules the
http module configuration is retrieved like this (in a lets say
postconfiguration handler):

static ngx_int_t postconfiguration_handler(ngx_conf_t* cf)
{
ngx_http_core_main_conf_t* nginx_http_configuration =
reinterpret_cast<ngx_http_core_main_conf_t*>(ngx_http_conf_get_module_main_conf(cf,
ngx_http_core_module));
        ...

If I'm not overlooking something this will not work (and in my case does
not) with a dynamic module
the ngx_http_core_module.ctx_index is not initialized since the initialized
version of ngx_http_core_module lives inside nginx.exe (where it is set by
ngx_count_modules) and my dll does not see that. If could run through the
module list and find what I need, but I just wanted to know if there is a
better solution already in place.

Best Regards,
Rudolfs Bundulis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20160810/1ef6dbe7/attachment.html>


More information about the nginx-devel mailing list