On Wed, Dec 23, 2009 at 1:47 PM, agentzh <agentzh@gmail.com> wrote:
> Understood. How about this?
>
> location /first {
> echo "before";
> echo_location_async /second $uri;
> echo "after";
> }
>
> location = /second {
> set $memcached_key $query_string;
> memcached_pass 127.0.0.1;
> }
>
Actually there's always more than one way to do it in nginx. If you
really want to use regexes and match captures, try the following
version of config with "if" statement:
location /first {
echo "before";
echo_location_async /second $request_uri;
echo "after";
}
location = /second {
if ($query_string ~ '([^?]+)') {
set $memcached_key $1;
echo $memcached_key;
}
}
Tested successfully on my side ;)
Happy hacking nginx config files! :D
Cheers,
-agentzh
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx