Nginx:Purge,ngx_cache_purge模块

一、介绍

        ngx_cache_purge是由labs.frickle.com开发的一个Nginx第三方模块。

        通过该模块使得Nginx可以使用PURGE指令手动清除指定URL的缓存页面。

二、下载、编译到Nginx

2.1 下载ngx_cache_purge

        官网:http://labs.frickle.com/nginx_ngx_cache_purge/

        官方git:https://github.com/FRiCKLE/ngx_cache_purge/

        文件名:ngx_cache_purge-2.3.tar.gz

        tar zxvf ngx_cache_purge-2.3.tar.gz

2.2 将ngx_cache_purge编译到nginx

        ./configure --add-module=/opt/software/ngx_cache_purge-2.3

        make

        make install

三、Nginx.conf配置

        proxy_cache_purge PURGE from 127.0.0.1;

        完整配置可以参照:

                Nginx:作为缓存,支持Range回源:http://blog.csdn.net/guowenyan001/article/details/50836490

四、使用

        curl -x 127.0.0.1:80 http://www.guowenyan.cn/index.html -X PURGE


参考资料:

        nginx ngx_cache_pure模块介绍:http://wenku.baidu.com/link?url=BUELHHa4_M5I-VRFqAOMcDNQIpWdIkcPWbU1B9iezKWC7cnqs01sBXXDrPBmegpOT8_02wyRzFkGYIse-zVv-BTNKc-jbRqDGYl8UaAcRcG

猜你喜欢

转载自blog.csdn.net/kanguolaikanguolaik/article/details/50848969