Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使nginx缓存无效_Nginx - Fatal编程技术网

使nginx缓存无效

使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

使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 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;
    }