4 messages in ru.sysoev.nginxmemcache_pass not allowed in if block?
FromSent OnAttachments
John LuxfordMar 21, 2009 4:34 pm 
Marcus ClyneMar 21, 2009 6:13 pm 
John LuxfordMar 21, 2009 9:01 pm 
Marcus ClyneMar 21, 2009 9:19 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:memcache_pass not allowed in if block?Actions...
From:John Luxford (john@gmail.com)
Date:Mar 21, 2009 4:34:25 pm
List:ru.sysoev.nginx

Hi,

I would like to check for a session cookie before using memcached_pass, since authenticated users in our site would be seeing more dynamic content on the same pages that anonymous users would see cached copies of. But when I do something like this:

if ($http_cookie != "session_id=") { set $memcached_key $uri; memcached_pass 127.0.0.1 11211; default_type text/html; }

I get the following error:

2009/03/21 18:20:27 [emerg] 78240#0: "memcached_pass" directive is not allowed here in /opt/local/etc/nginx/sites.conf:29

I see that fastcgi_pass can be used in if blocks, so why can't memcached_pass too? And is there any workaround to this? I'm just getting up to speed on configuring nginx, but can't seem to find another way of going about this.

Thanks!

Lux