location ~ ^/photo/(.+\.jpe?g)$ { root /store; set $path /public/photos/$1; if (redis2_query exists "somekey") { set $path /protected/photos/$1; } try_files $uri =404;}
do you mean:redis2_query exists $arg_name;
Yeah, but how use it in nginx's if?