question regarding the "server" directive handler function

Mauro Stettler mauro.stettler at gmail.com
Fri Feb 19 15:18:13 MSK 2010


hi

some time ago i wrote the nginx module upstream_consistent_hash which
is also presented on the nginx wiki:
http://wiki.nginx.org/Nginx3rdPartyModules#Upstream_Consistent_Hash

so this module actually works and is compatible to the php memcache
module. but i have the following problem. if you specify memcache
hosts, using dns names, then the php-memcache module will build the
hashring based on the dns names that are entered, but the nginx
upstream_consistent_hash module builds the hashring based on the
resolved ips.
i'm looking for a way to fix this. for this the directive handler
function ngx_http_upstream_consistent_hash would need to get the
actual strings which are entered into the config somehow, not only the
resolved ips. so i've read through the code of the upstream module
where it handles the "server" directive. and if i understand that code
there right, there is actually no way to retrieve the entered strings
without patching the upstreams module, because the upstreams module
seems to resolve the names via ngx_parse_url and then only keeps
certain data of the ngx_url_t struct, but not the actual entered
string.

is that right, do i really have to patch the upstreams module, or did
i (hopefully) miss something?

thanks,

mauro



More information about the nginx mailing list