6

On nginx docs there is an example of split_clients directive:

split_clients "${remote_addr}AAA" $variant {
               0.5%               .one;
               2.0%               .two;
               *                  "";
}

In general I understand how this directive works, but I cannot understand what the purpose of AAA suffix is.

Please help

Oleg
  • 306

1 Answers1

7

"AAA" is just an ordinary string. IP address from $remote_addr variable and string "AAA" are concatenated and hashed into a 32-bit number. In case there are two requests from the same IP, this ensures that the value for the $variant variable will be the same.

Tubeless
  • 1,730