FRiCKLE / ngx_cache_purge

nginx module which adds ability to purge content from FastCGI, proxy, SCGI and uWSGI caches.
http://labs.frickle.com/nginx_ngx_cache_purge/
Other
1.06k stars 311 forks source link

not sure how to use/implement #9

Open michelkaeser opened 11 years ago

michelkaeser commented 11 years ago

Hi there

Thank you for this wonderful module - it's exactly what I need for my shared hosting server having nginx in front of apache caching the proxy_pass. However, I can't figure out how to define the location that can be used to purge the cache..

My cache config is:

# Set locations and sizes
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=nginx_cache:5m inactive=7d max_size=512m;
proxy_temp_path /tmp/nginx;

# Putting the host name in the cache key allows different virtual hosts to share the same cache zone
proxy_cache_key "$scheme://$host$request_uri";

# Cache different return codes for different lengths of time
proxy_cache_valid 200 302 5m;
proxy_cache_valid 404 1m;

so every vhost uses the same cache.

Would you mind putting me on the correct road on how to config the purge location?

I tried something like:

location = /purge {
    proxy_cache_purge nginx_cache;
}

but that didn't work.

It doesn't matter if the solution only clears the cached files from the domain it's called or the whole cache (of course 1st would be better) - but I'd really appreciate it if you could help me :)

Thanks a lot!

nginx: 1.26 compiled from source Debian 6.0.6

nixmomo commented 8 years ago

Look at your Syntax and take a look at the Syntax in Doku syntax: proxy_cache_purge zone_name key

In Your Syntax is the Key missing