<div>I'd like to setup a reverse proxy with cache that will allow me to...<br></div><div><br></div><div>1. expose two different locations...<br></div><div>location /foo {}<br></div><div>location /bar {}<br></div><div><br></div><div>2. resolve to the same pass-through...<br></div><div>location /foo {<br></div><div>   proxy_pass "http://myhost.io/go";<br></div><div>}<br></div><div>location /bar {<br></div><div>  proxy_pass "http://myhost.io/go";<br></div><div>}<br></div><div><br></div><div>3. use the same cache...<br></div><div>location /foo {<br></div><div>   proxy_pass "http://myhost.io/go";<br></div><div>   proxy_cache shared_cache;<br></div><div>}<br></div><div>location /bar {<br></div><div>   proxy_pass "http://myhost.io/go";<br></div><div>   proxy_cache shared_cache;   <br></div><div>}<br></div><div><br></div><div>4. use _different_ cache valid settings...<br></div><div>location /foo {<br></div><div>   proxy_pass "http://myhost.io/go";<br></div><div>   proxy_cache shared_cache;<br></div><div>   proxy_cache_valid any 5m;<br></div><div>}<br></div><div>location /bar {<br></div><div>   proxy_pass "http://myhost.io/go";<br></div><div>   proxy_cache shared_cache; <br></div><div>   proxy_cache_valid any 10m; <br></div><div>}<br></div><div><br></div><div>What I have found is that I can request /foo, then /bar and the /bar result will be an immediate HIT on the cache, which is good - the keys are the same and they are both aware of the cache. However, now that I've requested /bar any requests to /foo will result in cache HITs for 10 minutes instead of the 5 minutes I want. If I never hit /bar, then /foo will cache HIT for the correct 5 minutes.<br></div><div><br></div><div>Any thoughts on how I can use NGINX to configure my way into a solution for my unusual (?) use-case?<br></div><div><br></div>