清除缓存:
上述配置的proxy_cache_purge指令用于方便的清除缓存,但必须按照第三方的ngx_cache_purge模块才能使用,使用ngx_cache_purge模块清除缓存(直接删除缓存目录下的文件也算一种办法):GET方式请求URL,即使用配置文件中的location ~ /purge(/.*),浏览器访问http://192.168.31.83/purge/your/may/path来清除缓存
缓存清除成功。
备注: (1)purge是ngx_cache_pure模块指令 (2)your/may/path是要清除的缓存文件URL路径
2)若只有一台客户端要验证负载均衡和健康检查可以先关掉缓存功能和保持session会话
#proxy_buffering off;
#sticky
扩展知识1:
nginx修改版本等信息1、vi /usr/local/src/nginx-1.0.12/src/core/nginx.h #编译前编辑#define nginx_version#define NGINX_VERSION#define NGINX_VER#define NGINX_VAR修改上面的信息,即可更改nginx显示版本。2、vi/usr/local/src/nginx-1.0.12/src/http/ngx_http_special_response.c #编译前编辑static u_charngx_http_error_full_tail[] =static u_charngx_http_error_tail[] =修改上面的信息为你自己的。3、vi/usr/local/src/nginx-1.0.12/src/http/ngx_http_header_filter_module.c #编译前编辑static char ngx_http_server_string[]=修改上面的信息为你自己的。4、编译完成之后,修改/usr/local/nginx/conf目录下面fastcgi.conf、fastcgi.conf.default、fastcgi_params、fastcgi_params.default这四个文件里面的版本名称/usr/local/nginx/sbin/nginx -V #查看nginx版本号
发表评论