split traffic

Reinis Rozitis r at roze.lv
Wed May 22 12:31:14 UTC 2019


> How can I achive this, any ideas? Thank you.
> 
>
> map $remote_addr $is_web_internal  {
>        202.212.93.190  1;
>       default  0;
> }
>
> if ($is_web_internal) {
> return 301 https://new.domain.com.tr$uri ;
>  }


Basically the same - you can just replace the map directive to split_clients 

split_clients $remote_addr $is_web_internal  {
  10% 1;
  *   0;  
}

 if ($is_web_internal) {
 return 301 https://new.domain.com.tr$uri ;
 }


Then roughly ~10% of the clients will get the redirect.

rr



More information about the nginx mailing list