Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

How to access module configs from init_process

$
0
0
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.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>