1、下载ngx_cache_purge: http://labs.frickle.com/nginx_ngx_cache_purge/
2、下载nginx :http://nginx.org/download/nginx-1.4.1.tar.gz
3、下载zlib :http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz?download
4、下载pcre :http://sourceforge.net/projects/pcre/files/pcre/8.33/pcre-8.33.tar.gz/download
5、解压
将上面所有包解压到同一目录。
6、安装
cd /work/
进入解压后的nginx-1.4.1目录,执行。
./configure --prefix=/work/nginx --with-pcre=/works/pcre-8.33 --with-zlib=/work/zlib-1.2.7 --add-module=/work/ngx_cache_purge-2.1
make && make install
cd /work/nginx
mdkir proxy_temp_path
mdkir proxy_cache_path
7、配置 nginx.conf
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { use epoll; worker_connections 51200; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; tcp_nopush on; server_names_hash_bucket_size 64; keepalive_timeout 65; tcp_nodelay on; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; connection_pool_size 512; client_header_buffer_size 1k; #large_client_header_buffers 4 2k; request_pool_size 4k; output_buffers 4 32k; postpone_output 1460; client_max_body_size 10m; client_body_buffer_size 256k; proxy_temp_path /work/nginx/proxy_temp_path; proxy_cache_path /work/nginx/proxy_cache_path levels=1:2 keys_zone=ngx_cache:200m inactive=1d max_size=30g; fastcgi_connect_timeout 200; fastcgi_send_timeout 200; fastcgi_read_timeout 200; fastcgi_buffer_size 128k; fastcgi_buffers 4 128k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; fastcgi_temp_path /dev/shm; gzip on; gzip_comp_level 9; gzip_min_length 1k; gzip_buffers 4 8k; gzip_http_version 1.1; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on; upstream my_server_pool{ server 100.22.160.67:8080; } server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location ~ /purge(/.*){ proxy_cache_purge ngx_cache $host$1$is_args$args; error_page 405 =200 /purge$1; } if ( $request_method = "PURGE" ) { rewrite ^(.*)$ /purge$1 last; } location / { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; #proxy_pass http://my_server_pool; root ../html/; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_cache ngx_cache; proxy_cache_valid 200 304 12h; proxy_cache_valid 301 302 1m; proxy_cache_valid any 1m; add_header NGX_CACHE $upstream_cache_status; proxy_cache_key $host$uri$is_args$args; proxy_pass http://my_server_pool; } } }
8、启动nginx sbin/nginx
#用于清除缓存,假设一个URL为http://xxx.test.com/test.gif,通过访问
#http://xxx.test.com/purge/test.gif可以清楚该url的缓存
相关推荐
ngx_cache_purge 是 nginx 模块,此模块可以清理 nginx 的 FastCGI、proxy、 SCGI 和 uWSGI 的缓存。配置指令(相同位置语法)fastcgi_cache_purgesyntax: fastcgi_cache_purge on|off|<method> [from all|<ip> [.....
nginx_cache_purge,用于清楚nginx缓存的小工具
ngx_cache_purge_2.4.2.tar.gz
ngx_cache_purge-1.3.tar.gz
nginx-1.0.12_ngx-cache-purge1.5.tar.gz
在功能上,Nginx已经具备Squid所拥有的Web缓存加速功能、清除指定URL...–by 张宴 下载2011-05-03更新的最新版1.3wget http://labs.frickle.com/files/ngx_cache_purge-1.3.tar.gztar zxf ngx_cache_purge-1.3.tar.g
ngx_slowfs_cache 是 nginx 模块,允许缓存静态文件(使用 root 指令管理)。 这使得能够为存储在慢文件系统上的文件...}清理缓存需要借助插件 ngx_cache_purge 使用案例:nginx扩展模型ngx_slowfs_cache本地静态缓存
fastdfs-5.05.tar.gz : FastDFS安装主文件包 libfastcommon-master.zip: FastDFS文件系统依赖包 nginx-1.8.1.tar.gz:nginx安装包 fastdfs-nginx-module_v1.16.tar.gz: nginx下...ngx_cache_purge-2.1.tar.gz:缓存
利用Nginx的proxy_cache搭建缓存服务器一:编译ngx_cache_purge 1、Nginx的Proxy_cache是根据Key值md5哈希存储缓存,支持任意的Key,例如你可以根据”域名、URI、参数”组合成key,也支持非200状态码,如404/302等...
nginx-1.11.3.tar.gz,echo-nginx-module-0.59.tar.gz,ngx_cache_purge-2.3.tar.gz,nginx_upstream-fair-a18b409.tar.gz,keepalived
fastdfs5.08+nginx1.14.0+libfastcommon_v1.04+ngx_cache_purge-master+fastdfs_client_java_v1.10.tar+apache-tomcat-8.5.34.tar+keepalived-1.2.20.tar
(注意注意,里面有个文件libfastcommon_v1.01.tar.gz不太好用,大家可以去这个地址 http://download.csdn.net/download/simuhunluo/10114036 单独下载一个可用的1.07版本)(在这里上传... ngx_cache_purge-2.3.tar.gz
包含以下模块,源自CentOS 7.6.1810 x86_64 系统构建 ``` ngx_devel_kit ...ngx_cache_purge nginx-sticky-module openssl pcre-8.43 ngx_http_substitutions_filter_module dav-ext security vts rtmp ```
ngx_cache_purge-2.1.tar.gz pcre-8.34.tar.gz zlib-1.2.8.tar.gz 安装方法:...
nginx-upload-module安装依赖包,包括了 ngx_cache_purge-2.3.tar.gz,zlib-1.2.11.tar.gz,pcre2-10.32.tar.gz,nginx-upload-module-2.2.zip
cache_purge3、安装需要的依赖软件包yum -y install gcc openssl openssl-devel pcre-devel pcre ngx_cache_purge4、下载trngine-2.2.0tar.gz5、解压tengine-2.2.0.tar.gztar -zxvf tengine-2.2.0.tar.gz6...
fastdfs所需的最全安装包及依赖包 FastDFS_v5.05.tar.gz、fastdfs-nginx-module_v1.16.tar.gz、libfastcommon-master.zip、nginx-1.11.4.tar.gz、ngx_cache_purge-2.3.tar.gz
Nginx安装配置1.源码安装上传openssl-1.0.1s.tar.gz、pcre-8.38.tar.bz2、ngx_cache_purge-2.3.tar
包含模块nginx, nginx doc, Lua, Naxsi, Rtmp, HttpSubsModule,echo-nginx, lower_upper_case, headers-more,auth_ldap, set-misc, lua-...ngx_cache_purge, nginx-http-concat, nginx-vod-module,nginx-module-vts
安装FastDFS所需安装包 fastdfs-nginx-module_v1.16.tar FastDFS_v5.05.tar libfastcommon-1.0.7.tar nginx-1.8.0.tar ngx_cache_purge-2.3.tar