FRiCKLE / ngx_cache_purge

nginx module which adds ability to purge content from FastCGI, proxy, SCGI and uWSGI caches.
http://labs.frickle.com/nginx_ngx_cache_purge/
Other
1.06k stars 310 forks source link

Fix compatibility with nginx-1.11.6+ #51

Open psulowicz opened 7 years ago

nerux1 commented 7 years ago

It works great with nginx version 1.12.0

zakiharis commented 6 years ago

Successfully purged with nginx 1.13.3

root@something:~# curl -i -X DELETE -H "Host: cdn.domain.test" localhost/files/file.txt
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 10 Oct 2017 07:13:36 GMT
Content-Type: text/html
Content-Length: 282
Connection: keep-alive

<html>
<head><title>Successful purge</title></head>
<body bgcolor="white">
<center><h1>Successful purge</h1>
<br>Key : 248455226:0:/files/file.txt
<br>Path: /var/cache/nginx/8/c9/8890acdc10c07a1130c4d2337132cc98
</center>
<hr><center>nginx/1.13.3</center>
</body>
</html>

Before adding this patch

root@something:~# curl -i -X DELETE -H "Host: cdn.domain.test" localhost/files/file.txt
HTTP/1.1 502 Bad Gateway
Server: nginx
Date: Tue, 10 Oct 2017 06:58:08 GMT
Content-Type: text/html
Content-Length: 166
Connection: keep-alive

<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
szepeviktor commented 6 years ago

@PiotrSikora Would it be possible to merge?

July-G commented 6 years ago

In nginx 1.12.2, I found the "separate location syntax" does not work, could anybody confirm?
When configuring with separate location syntax, I always get 404, seem it does not honor the "separate location" at all.

jiajunsu commented 6 years ago

This patch worked with 1.14.0. @PiotrSikora Could you please merge it?