How to iterating all server context in init_module function

I need a clue for my problem when building my first module:

in nginx.conf i set something like this:

http {
server {
listen 80;
server_name serverA;
UploadStoragePath /temp/A;
#blah etc…
}
server {
listen 80;
server_name serverB;
UploadStoragePath /temp/B;
#blah etc…
}
}

i have a server context variable:

typedef struct {
ngx_path_t *UploadStoragePath;
ngx_str_t AdminEMailAddress;
} ngx_http_testing_srv_conf_t;

static char *ngx_http_testing_merge_srv_conf(ngx_conf_t *cf, void
*parent, void *child)
{
// i successfuly set “UploadStoragePath” variable for each server
// here
}

then, i want to set “AdminEMailAddress” variable in init_module
function:

static ngx_int_t ngx_http_testing_init_module(ngx_cycle_t *cycle)
{
// problem here
// how to set “AdminEMailAddress” variable for each server?
// , something like iterating each server context here
}

please help me.

Regards

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs