I would like to know if I can configure nginx to utilise different set
cache zone conditionally.
- if the user-agent is a mobile device then use proxy_cache zone called
- if $http_cookie contains the word “semi-static” then use proxy_cache
- if user IP address is 126.96.36.199/16 then use proxy_cache zone called
- Serve the rest using proxy_cache zone default_zone
At this point, I don’t mind having the rules as first hit first serve (
if it matched user-agent then just use mobile_proxy_zone even when the
semi-static is present on the $http_cookie )
Is this do able ?
Can we specify the proxy zone dynamically ?
Posted at Nginx Forum: