proxy_cache_bypass and proxy_no_cache

Igor Sysoev igor at sysoev.ru
Mon Dec 10 11:24:02 UTC 2012


On Dec 10, 2012, at 14:22 , amodpandey wrote:

> One interesting observation 
> 
> I put this code 
> 
>        location /test {
>            proxy_pass http://a/;
>            ....
>            set $dont_cache 1;
> 
>            if ( $cookie_route ) {
>                     set $dont_cache 0;
>            }
>            proxy_cache_bypass    $dont_cache;
>            proxy_no_cache        $dont_cache;           
> 
>        }
> 
> and it started to dis-honour the trailing slash http://a/ With the end / it
> does not look for /test but only due to the if block it started to look for
> it.

Do not use "if", use "map" instead.


--
Igor Sysoev
http://nginx.com/support.html



More information about the nginx mailing list