http {
# ...
# application version 1a
upstream version_a {
server server 127.0.0.1:7770; ## Can be an external ip too
}
# application version 1b
upstream version_b {
server server 127.0.0.1:7777; ## Can be an external ip too
}
split_clients "app${remote_addr}${http_user_agent}${date_gmt}" $appversion {
80% version_1a;
* version_1b;
}
server {
# ...
listen 80;
location / {
proxy_set_header Host $host;