Set header based on memcached request - mod_eval

Peter Hinse loco at
Fri Jun 3 18:55:54 MSD 2011

Hi all,

I try to set a HTTP header for a proxy request based on some variable I
get from memcached with the eval module:

location / {
  eval $role {
    set $memcached_key $cookie_sessionid;
  proxy_set_header X-Role $role;

I can see the memcached request, however the HTTP requests to the nginx
server just hangs for some seconds and no proxy request is done to the
backend server.

Any ideas?

# nginx -V
nginx: nginx version: nginx/1.0.4
nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
nginx: TLS SNI support disabled
nginx: configure arguments: --user=nginx --group=nginx
--prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx
--pid-path=/var/run/ --lock-path=/var/lock/subsys/nginx
--with-http_secure_link_module --with-http_random_index_module
--with-http_ssl_module --with-http_realip_module
--with-http_addition_module --with-http_sub_module
--with-http_dav_module --with-http_flv_module
--with-http_gzip_static_module --with-http_stub_status_module
--with-http_perl_module --with-mail --with-mail_ssl_module
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386
-mtune=generic -fasynchronous-unwind-tables' --with-ipv6 --with-file-aio


More information about the nginx mailing list