Nginx + memcached_pass but nothing caching?

Mitchua Mitchua lists at ruby-forum.com
Sun Feb 1 10:30:59 MSK 2009


Hi!

I'm trying to use Nginx as a proxy to cache static files off the backend
servers.  I got nginx and memcached up and running on Fedora core, and I
can configure it so that it serves the right files.  However, I can't
find any evidence that it is caching anything.  I've tried setting
various http headers on the files going through the proxy
(Cache-control: max-age=600,public)

The configuration looks like this which is totally vanilla:
server {
    location / {
        set  $memcached_key  $uri;
        memcached_pass   name:11211;
        default_type     text/html;
        error_page       404 = /fallback;
    }

    location = /fallback {
        proxy_pass       backend;
    }
}

"backend" is a LAMP server sitting on a different machine and responding
on port 80.  If I look at memcached stats, nothing is going into the
cache but looks of lookups are happening.

Am I missing a step where I put results from proxy_pass into the cache?
What is preventing nginx from putting anything into cache?

Thanks so much for your help!

Cheers,
Mitchua
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list