1、nginx.conf
split_clients "${remote_addr}AAA" $request_type {
25% "abtest";
* "online";
}
2、mobile.vipkid.com.cn.conf
if ($request_type = "abtest") {
set $group _abtest;
}
proxy_pass http://mobile_vipkid_com_cn$group;
upstream mobile_vipkid_com_cn_abtest {
server 10.0.3.141:8080 weight=10 max_fails=3 fail_timeout=5s;
server 10.0.4.141:8080 weight=10 max_fails=3 fail_timeout=5s;
}
upstream mobile_vipkid_com_cn {
server 10.0.3.142:8080 weight=10 max_fails=3 fail_timeout=5s;
server 10.0.4.142:8080 weight=10 max_fails=3 fail_timeout=5s;
}
05-11 17:47