Question about proxy_cache_key

Dewangga Bachrul Alam dewanggaba at xtremenitro.org
Thu Feb 16 06:08:35 UTC 2017


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello!

I've compiled latest nginx 1.11.10 with ngx_cache_purge, my
configurations likes:

proxy_cache_key "$uri$is_args$args";
proxy_cache_path /var/cache/nginx/proxy_cache levels=1:2
keys_zone=networksninja_cache:60m inactive=60m use_temp_path=off
max_size=8192m;

And location syntax is :

location / {
         proxy_pass      http://10.8.0.10:80;
         proxy_cache     networksninja_cache;
         proxy_cache_purge       PURGE;
         proxy_cache_use_stale error timeout updating http_500
http_503 http_504;
         proxy_cache_valid 200 302 5m;
         proxy_cache_valid any 3s;
         proxy_cache_lock on;
         proxy_cache_revalidate on;
         proxy_cache_min_uses 1;
         proxy_cache_bypass      $arg_clear;
         proxy_no_cache          $arg_clear;
         proxy_ignore_headers Cache-Control Expires Set-Cookie;
         rewrite (?<capt>.*) $capt?$args&view=$mobile break;
}

My question is, the URI
https://subdomain.domain.tld/artikel/berita/a-pen-by-hair accessed
from another browser (eg. Safari) and cache status was HIT, then I
tried to invoke `PURGE` command from shell using cURL, it was failed
and return cache_key not found

But, if the URI accessed from shell using cURL and PURGE command was
invoke from shell too, the cache_key found, but returning only like this
:

<html>
<head><title>Successful purge</title></head>
<body bgcolor="white">
<center><h1>Successful purge</h1>
<br>Key : /artikel/berita/a-pen-by-hair&view=desktop?
<br>Path:
/var/cache/nginx/proxy_cache/a/5e/7527d90390275ac034d4a3d5b2e485ea
</center>
<hr><center>nginx/1.11.10</center>
</body>
</html>

The following argument "&view=desktop?" should be follow. Is there any
hints to match the proxy_cache_key? So I can purge the cache anywhere
and anytime?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQI4BAEBCAAiBQJYpUHfGxxkZXdhbmdnYWJhQHh0cmVtZW5pdHJvLm9yZwAKCRDl
f9IgoCjNcCz/D/wJqeJrn7vkxh2Nm7ZFAtBiNB7GL1oS3il7m7Rx7+rP9gZWVpOm
zFqap7Nv+qzZ96319soTxGDxB3enGKbkP9Rr8J6ica3X3p4vG1rUryxnQX5cbV77
E6ikNckkFXK26MLWnbXHee8YrLNUjhePpqPZYpSvIMWpumTH2XtY3+EYRWlDFWJY
6tOqTTsz6nkvgXvcnrAvPl1oHfysm2Lzc773sd0uWxE/ue4DHQleKNVzG67tXxNF
YFQCPp3Fa3qlK8F3s3jf/tgw/uZ6gwmDn4/0z6WiqIQ8HGxyEYdhxFr+1lJaWjG9
j6iYFjf/stpC9EHTvLH3NDvv0MSR38eeIvTB5SYiI/yGwsx+I+izHZn26Z1vYUeh
QNkZhvjSpd6truliYQU6ftBR796LspM8LdoQuLB3z2Swg2BD1SB1vL3/Cm9Lwwoe
MY3ghSKiVHyV9adySDCK9MWK/g77Cq3GUIXBW3uWFyBPTgqE84kRibw6tHI4Edaf
r2gZPqT0N0qBr4cs6/6Q+84PNFCjQtr2lIB7UzNXV7leZRU5gax6rJN2wE6KemD5
pHRdocVM8QDKW4XJRBAjrdgYMsQu3DBLffsxFCCR75HIOnrxKxEWn4mk2qKtDTVO
+lsSxancZ77VU2aZvh7znZ7dUy7eQQ6oA3OtR19h4yCccDbq5UrJxQLTeQ==
=x9J2
-----END PGP SIGNATURE-----


More information about the nginx mailing list