I'm trying to figure out how to access http upstream module's config from init process handler.
I tried:
static ngx_int_t
ngx_http_upstream_lb_init_process(ngx_cycle_t *cycle)
{
ngx_http_conf_ctx_t *conf_ctx;
ngx_http_upstream_srv_conf_t *uscf;
.....
// 1.
conf_ctx = ((ngx_http_conf_ctx_t *)cycle->conf_ctx[ngx_http_module.index]);
uscf = ((ngx_http_upstream_srv_conf_t *)cycle->conf_ctx[ngx_http_upstream_module.index]);
// 2.
uscf = ngx_event_get_conf(cycle->conf_ctx, ngx_http_upstream_module);
.....
}
Neither works for me.
Neither can I access my own module's configs (upstream, location, ...)
Thank you.
I tried:
static ngx_int_t
ngx_http_upstream_lb_init_process(ngx_cycle_t *cycle)
{
ngx_http_conf_ctx_t *conf_ctx;
ngx_http_upstream_srv_conf_t *uscf;
.....
// 1.
conf_ctx = ((ngx_http_conf_ctx_t *)cycle->conf_ctx[ngx_http_module.index]);
uscf = ((ngx_http_upstream_srv_conf_t *)cycle->conf_ctx[ngx_http_upstream_module.index]);
// 2.
uscf = ngx_event_get_conf(cycle->conf_ctx, ngx_http_upstream_module);
.....
}
Neither works for me.
Neither can I access my own module's configs (upstream, location, ...)
Thank you.