[NGINX] condition proxy_cache

merlin corey merlincorey at dc949.org
Sat Feb 13 03:39:44 MSK 2010


2010/2/11 Jérôme Loyet <jerome at loyet.net>:
> Hi,
>
> is there a way to disable proxy_cache on specific get parameters or
> http headers ?
>
> for example, this doesn't work:
>
> if ($args ~* nocache=) {
>  proxy_cache off;
> }
>
>
> Thx
> ++ jerome
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

Of course it doesn't work, the setting is only inside the sublocation
created by if, and so after that, it's back on.

This is just my simplified and limited understanding of things...
Basically, if doesn't work the way people think it does in NginX. Some
more can be found at http://wiki.nginx.org/IfIsEvil .

A possible "workaround" might be to proxy to different back-end
nginx's based on the arguments, one with caching enabled, one with
caching disabled.

-- Merlin



More information about the nginx mailing list