I'm using an Nginx cache for an application of mine. I would like to bypass the cache for one very specific request string. I thought I could achieve that using something like the following:
location / {
if($uri ~ .*(ServerCheck).*) {set $nocache 1; }
proxy_pass http://127.0.0.1:9001/;
proxy_no_cache $nocache;
proxy_cache_bypass $nocache;
proxy_cache crownstudent;
proxy_cache_valid 200 1y;
proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503 http_504;
}
However, this doesn't seem to work. Is there any way I can make this happen? The Nginx documentation is very unclear and lacking in examples.
Thanks!