Is there a wait to get at a module's main conf inside the loc conf's init?

ptcell nginx-forum at forum.nginx.org
Thu Aug 10 18:46:17 UTC 2017


Maxim Dounin Wrote:
-------------------------------------------------------
> Hello!
> 
> On Wed, Aug 09, 2017 at 09:33:59PM -0400, ptcell wrote:
> 
> > From the debugger I can see that it's probably some offset into
> > cf->ctx[index].main_conf, but I don't see anyway of knowing what
> that index
> > is inside the loc create callback.
> > 
> > Is there any other way of getting this?    Getting it at loc merge
> time
> > would be acceptable too.
> 
> Try ngx_http_conf_get_module_main_conf().
> 
> (Doing so in the create_loc_conf callback is probably pointless 
> though, as main conf contents can be changed later.)
> 
> -- 
> Maxim Dounin
> http://nginx.org/
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx


Thank you.  I saw that similar macro for requests, but missed it for
configs.  I see now the module entity has a static index on it.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,275998,276014#msg-276014



More information about the nginx mailing list