使nginx缓存无效
使URl无效: --从nginx反向代理缓存中删除页面。 位置^~/invalidate\u cached\u url/{ 允许127.0.0.1; 否认一切; 代理缓存清除nginx\u缓存$arg\u url; }使nginx缓存无效,nginx,Nginx,使URl无效: --从nginx反向代理缓存中删除页面。 位置^~/invalidate\u cached\u url/{ 允许127.0.0.1; 否认一切; 代理缓存清除nginx\u缓存$arg\u url; } I have cached js,css and html files using nginx to improve web page performance. how can i invalidate nginx cache for specific cach
I have cached js,css and html files using nginx to improve web page performance.
how can i invalidate nginx cache for specific cache key?
I have implemented like follows:
请使用免费模块。
用法示例:
when i start nginx service it is giving error "unknown directive :proxy_cache_purge".
- test.com/myimage.png-添加到缓存的url
- test.com/清除/myimage.png-从缓存中删除url
location / {
proxy_pass http://127.0.0.1:8080;
location ~ /purge(/.*) {
proxy_cache_purge cache "$host$1";
}
location ~* ^.+\.(jpeg|jpg|png|gif|bmp)$ {
try_files $uri @fallback;
}
}
location @fallback {
rewrite ^(.*)$ /image.php?id=$1;
proxy_pass http://127.0.0.1:8080;
}