【发布时间】:2019-04-05 14:39:38
【问题描述】:
首先我搜索并尝试了一些文章:
1) https://www.ryadel.com/en/nginx-purge-proxy-cache-delete-invalidate-linux-centos-7/
第一种方式:
a) 通过 curl 请求(BYPASS)更新缓存,它适用于我,但没有通过通配符更新缓存的示例
b) 使用PURGE方法通过curl请求删除缓存,使用过时的模块ngx_cache_purge-2.3,但是通配符上没有更新缓存的例子,至少文章中配置的不适用我(nginx 1.14):
curl -X PURGE -I mysite.com/text.txt
curl: (52) 来自服务器的空回复
2) https://scene-si.org/2016/11/02/purging-cached-items-from-nginx-with-lua/; https://gist.github.com/titpetric/2f142e89eaa0f36ba4e4383b16d61474/revisions
第二种方式:
如果我理解正确的话,lua 需要 nginx 版本 1.10,而我的是 v1.14 并且 v.1.14 没有 lua 模块。
nginx: [emerg] 模块 "/usr/lib64/nginx/modules/ngx_http_lua_module.so" 版本 1010001 而不是 /etc/nginx/nginx.conf:1 中的 1014000
所以我的问题是:Nginx v1.14 清除缓存使用通配符 HTTP 请求是否有可行的方法,您可以提供建议吗?
最好的问候
【问题讨论】:
标签: nginx caching lua webserver cache-control