ab testing

Ivan bdfy at mail.ru
Fri Apr 8 03:42:08 MSD 2011


nginx doesn't have a rich programming language :). if - it is only a new localtion :).

see this example:

  (http://markmail.org/message/yv6x3z66x3a5jdv2)  http://markmail.org/message/yv6x3z66x3a5jdv2 (http://markmail.org/message/yv6x3z66x3a5jdv2) 

 
Thu, 7 Apr 2011 19:33:25 -0300 письмо от Jonathan Leibiusky <ionathan at gmail.com>:

hi! first I wanted to say that nginx is a great product!
I am trying to use it to route my traffic with several different rules. This way I can do ab testing.
My rules use different inputs, like http headers and uri of the request.
I am using right now the location block with regex. But when I need to do something more complex (like matching the query string and http_method) I can't find a way to do it as it seems like nginx doesn't have a rich programming language, which is reasonable. But I am sure there are ways to do what I want, like:

location ~ /items.* {
  if ($query_string ~ .*&amp;ids=.* &amp;&amp; $request_method = GET) {
    proxy_pass pool_a;
  }
  proxy_pass pool_b;
}

this is just an example, my rules can get more complex. what would be the recommended way to address this?

thanks!

jonathan
_______________________________________________
nginx mailing list
 nginx at nginx.org (sentmsg?compose&amp;To=nginx at nginx.org) 
  (http://nginx.org/mailman/listinfo/nginx)   (http://nginx.org/mailman/listinfo/nginx)   (http://nginx.org/mailman/listinfo/nginx)   (http://nginx.org/mailman/listinfo/nginx)   (http://nginx.org/mailman/listinfo/nginx)   (http://nginx.org/mailman/listinfo/nginx)  http://nginx.org/mailman/listinfo/nginx (http://nginx.org/mailman/listinfo/nginx) 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20110408/c82ed310/attachment.html>


More information about the nginx mailing list