<div dir="ltr">Hi Francis,<div><br></div><div>I am following <a href="https://bluegrid.io/edu/how-to-purge-the-nginx-cache/">https://bluegrid.io/edu/how-to-purge-the-nginx-cache/</a> and have attached the nginx config file for your reference. I am running nginx version: nginx/1.20.2 on CentOS Linux release 7.9.2009 (Core)</div><div><br></div><div>#curl -I <a href="https://testnginxproxycachepurge.testintcraft.com">https://testnginxproxycachepurge.testintcraft.com</a> -H 'Cache-Purge: true'<br>HTTP/1.1 200 OK<br>Server: nginx/1.20.2<br>Date: Tue, 03 May 2022 10:24:24 GMT<br>Content-Type: text/html; charset=UTF-8<br>Connection: keep-alive<br>Cache-Control: max-age=21600, public<br>Link: <<a href="https://testnginxproxycachepurge.testintcraft.com/">https://testnginxproxycachepurge.testintcraft.com/</a>>; rel="canonical", <<a href="https://testnginxproxycachepurge.testintcraft.com/">https://testnginxproxycachepurge.testintcraft.com/</a>>; rel="shortlink", <<a href="https://testnginxproxycachepurge.testintcraft.com/home">https://testnginxproxycachepurge.testintcraft.com/home</a>>; rel="revision"<br>X-UA-Compatible: IE=edge<br>Content-language: en<br>X-Content-Type-Options: nosniff<br>X-Frame-Options: SAMEORIGIN<br>Permissions-Policy: interest-cohort=()<br>Expires: Sun, 19 Nov 1978 05:00:00 GMT<br>Vary: Cookie<br>X-XSS-Protection: 1; mode=block<br>Strict-Transport-Security: max-age=31536000; includeSubDomains<br>Set-Cookie: ADRUM_BT=R%3A0%7Cg%3A39ca00fc-b183-4fbf-95ad-494a6e7b8d1f99%7Cn%3Aicebergtest_e1c60ae6-5d00-47d5-8c0a-690d8465795f%7Ci%3A129601%7Cs%3Af%7Ch%3Ae; expires=Tue, 03-May-2022 08:39:15 GMT; Max-Age=30; path=/<br>Last-Modified: Tue, 26 Apr 2022 11:42:25 GMT<br>ETag: "1650973345"<br>Access-Control-Allow-Origin: *<br><b>X-Cache-Status: HIT</b><br></div><div><br></div><div>Please guide me. Thanks in advance. <br></div><div><br></div><div>Best Regards,</div><div><br></div><div>Kaushal<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 3, 2022 at 1:59 PM Francis Daly <<a href="mailto:francis@daoine.org">francis@daoine.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Apr 29, 2022 at 12:54:42AM +0530, Kaushal Shriyan wrote:<br>
<br>
Hi there,<br>
<br>
> I am following<br>
> <a href="https://www.ryadel.com/en/nginx-purge-proxy-cache-delete-invalidate-linux-centos-7/" rel="noreferrer" target="_blank">https://www.ryadel.com/en/nginx-purge-proxy-cache-delete-invalidate-linux-centos-7/</a><br>
> and <a href="https://bluegrid.io/edu/how-to-purge-the-nginx-cache/" rel="noreferrer" target="_blank">https://bluegrid.io/edu/how-to-purge-the-nginx-cache/</a> to purge cache. I<br>
> am attaching the nginx file for your reference.<br>
<br>
It's probably best to follow exactly one document, to avoid any confusion<br>
from mixing things.<br>
<br>
I think that you are following the second one here with its method number<br>
2, using the stock nginx proxy_cache_bypass directive.<br>
<br>
> $curl -I <a href="https://gsmanginxproxycachepurge.testapicraft.com" rel="noreferrer" target="_blank">https://gsmanginxproxycachepurge.testapicraft.com</a> -H<br>
> "secret-header: true"<br>
<br>
> *X-Cache-Status: HIT*<br>
> <br>
> I am seeing it as HIT instead of BYPASS and I am not sure about this term<br>
> between HIT vs MISS vs BYPASS vs EXPIRED in context to Nginx cache.<br>
<br>
Your configuration for <a href="https://gsmanginxproxycachepurge.testapicraft.com" rel="noreferrer" target="_blank">https://gsmanginxproxycachepurge.testapicraft.com</a><br>
reads the $bypass variable if it is set; but it never sets it, so it will<br>
be read as "empty", and the proxy_cache_bypass directive will *not*<br>
cause the cache to be bypassed in this case.<br>
<br>
If you want to use this method, you must ensure that your $bypass variable<br>
is set for the one request that you are making.<br>
<br>
Good luck with it,<br>
<br>
        f<br>
-- <br>
Francis Daly        <a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a><br>
_______________________________________________<br>
nginx mailing list -- <a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
To unsubscribe send an email to <a href="mailto:nginx-leave@nginx.org" target="_blank">nginx-leave@nginx.org</a><br>
</blockquote></div>