ngx_http_memcached_module question

Igor Sysoev is at rambler-co.ru
Fri Feb 29 23:35:27 MSK 2008


On Fri, Feb 29, 2008 at 12:58:42PM -0500, Sean Allen wrote:

> 
> On Feb 29, 2008, at 11:28 AM, Igor Sysoev wrote:
> 
> >On Thu, Feb 28, 2008 at 05:09:18PM -0500, Sean Allen wrote:
> >
> >>can i do the following:
> >>
> >>check memcache for existence of content.
> >>
> >>if not continue our normal processing which is currently:
> >>
> >>check for static file
> >> if it exists, serve it
> >> if it doesnt exist, pass request off to upstream server.
> >
> >The checking local file is faster than memcached, so:
> >
> >    location / {
> >        error_page  404 = @memcache;
> >    }
> >
> >    location @memcache {
> >        set   $memcached_key   "$uri?$args";
> >        memcached_pass    ...
> >
> >        recursive_error_pages  on;
> >
> >        error_page  404 = @upstream;
> >    }
> >
> >    location @upstream {
> >        proxy_pass    ...
> >
> >        error_page  404 = @upstream;

This error_page was unneeded.

> >    }
> 
> Well, this will serve from local file system and memcache but it isnt  
> passing to the upstream.
> just get an nginx 404 if it can find in local file system or memcache.

"recursive_error_pages on" should pass request to error_page hanlder.

> if i get that worked out, is there a way to have it just move on to  
> the upstream if the memcache is
> down  instead of returning a 502?

-        error_page  404 = @upstream;
+        error_page  404 502 504 = @upstream;


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list