Welcome! Log In Create A New Profile

Advanced

How to iterating all server context in init_module function

Wigunawan Wigunawan
October 21, 2010 12:32PM
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

--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to iterating all server context in init_module function

Wigunawan Wigunawan October 21, 2010 12:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 52
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready