M
M
Mitya Kolesnikov2018-05-29 11:07:09
Nginx
Mitya Kolesnikov, 2018-05-29 11:07:09

How to change the logic of redirection through split_clients in Nginx?

Hello!!
There is a configuration for redirecting users to different versions of the site:

split_clients "${remote_addr}" $designtest {
    25%     "1";
    25%     "2";
    25%     "3";
    25%     "4";
}

Traffic redirection works in this case in such a way that a certain value (from 1 to 4) is assigned to the client and assigned to it. When switching to a url for redirects, it always redirects to a previously defined variant by the hash of the ip address.
The question is how to make such an option so that the parameter is always forced to change for the same user? Those. traffic must be divided not among different clients, but for one client without fail so that it does not hit, let's say, 1 again, until it ends up on versions 2, 3 and 4.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question