Welcome! Log In Create A New Profile

Advanced

memcache_pass not allowed in if block?

John Luxford
March 21, 2009 07:54PM
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
Subject Author Posted

memcache_pass not allowed in if block?

John Luxford March 21, 2009 07:54PM

Re: memcache_pass not allowed in if block?

Marcus Clyne March 21, 2009 09:45PM

Re: memcache_pass not allowed in if block?

John Luxford March 22, 2009 12:22AM

Re: memcache_pass not allowed in if block?

Marcus Clyne March 22, 2009 12:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 74
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