How to disable proxy cache when query string is empty?
- by chx
With nginx I have
server {
listen 1.2.3.4:80
proxy_cache_valid 200 302 5m;
location / {
try_files $uri @upstream;
root $root;
}
}
When I go http://example.com/foobar it generates a redirect to http://example.com/foobar?filter_distance=50&... which is visitor dependent so I would like to not cache this redirect. I need to bypass cache when the query string is empty. I am a bit lost because location /foobar will match both.