Welcome! Log In Create A New Profile

Advanced

Accessing the location configuration of module 2 during post configuration processing of module 1 for a particular server

Rv Rv
June 09, 2014 02:10PM
How do we access the configuration of a an unrelated module in a given module. This may be required for example to check if the directives pertaining to module 2 were specified in location for a particular server that has directives for module 1 in its configuration.

From what I understand, code similar to this can be used 
/* Get http main configuration */
    cmcf = ctx->main_conf[ngx_http_core_module.ctx_index]; 

/* Get the list of servers */
    cscfp = cmcf->servers.elts;
/* Iterate through the list */
    for (s = 0; s < cmcf->servers.nelts; s++) {
  /* Problem : how to get the configuration of module 2*/
                  cscfp[s]->ctx->loc_conf[module2.ctx_index];-------------> does not yield the correct location struct of module 2

I did not find any documentation on how the configuration is stored within nginx using these structs 
typedef struct {
.............
 /* server ctx */ ngx_http_conf_ctx_t *ctx; ............

} ngx_http_core_srv_conf_t;


typedef struct {
    void        **main_conf;
    void        **srv_conf;
    void        **loc_conf;
} ngx_http_conf_ctx_t;_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Accessing the location configuration of module 2 during post configuration processing of module 1 for a particular server

Rv Rv June 09, 2014 02:10PM

Re: Accessing the location configuration of module 2 during post configuration processing of module 1 for a particular server

Maxim Dounin June 10, 2014 10:54AM

Re: Accessing the location configuration of module 2 during post configuration processing of module 1 for a particular server

Rv Rv June 12, 2014 01:52AM

Re: Accessing the location configuration of module 2 during post configuration processing of module 1 for a particular server

Maxim Dounin June 14, 2014 03:36PM

Re: Accessing the location configuration of module 2 during post configuration processing of module 1 for a particular server

Rv Rv June 16, 2014 03:02AM

Re: Accessing the location configuration of module 2 during post configuration processing of module 1 for a particular server

Maxim Dounin June 16, 2014 10:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 145
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready