Created
February 2, 2015 19:09
-
-
Save cardoni/88c64ab3bedde6d5bda4 to your computer and use it in GitHub Desktop.
Nginx Config for A/B testing (50%/50%)
This file contains hidden or 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
## | |
## Nginx Config for A/B testing (50%/50%) | |
## | |
split_clients "abtest${remote_addr}${http_user_agent}${date_gmt}" $variant { | |
50% "abtest.your_domain.com/a_test.html"; | |
* "abtest.your_domain.com/b_test.html"; | |
} | |
server { | |
listen 80; | |
server_name abtest.your_domain.com; | |
root /var/www/your_abtests_folder; | |
location / { | |
rewrite ^\/$ "${scheme}://${variant}" redirect; | |
} | |
# access_log off; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment