Created
May 19, 2017 11:09
-
-
Save vmanyushin/09ec77f4e070f40ff3de645ab8406f52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
split_clients "${remote_addr}${http_user_agent}${date_gmt}" $variant { | |
25% dg1; | |
25% dg2; | |
25% dg3; | |
25% dg4; | |
} | |
server { | |
listen 80; | |
listen 443 ssl; | |
server_name domain.lan; | |
if ($variant = dg1) { | |
set $redirect_url https://domain1.lan/url1; | |
} | |
if ($variant = dg2) { | |
set $redirect_url https://domain2.lan/url1; | |
} | |
if ($variant = dg3) { | |
set $redirect_url https://domain1.lan/url2; | |
} | |
if ($variant = dg4) { | |
set $redirect_url https://domain2.lan/url2; | |
} | |
location / { | |
return 302 $redirect_url; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment