Created
March 11, 2012 01:35
-
-
Save qzaidi/2014466 to your computer and use it in GitHub Desktop.
nginx a/b test config
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
upstream rrbackend { | |
server 127.0.0.1:8080 weight=3; | |
server 127.0.0.1:8888; | |
} | |
map $cookie_backend $backend { | |
default rrbackend; | |
experimental 127.0.0.1:8888; | |
} | |
map $cookie_backend $everything { | |
default 127.0.0.1:8080; | |
experimental 127.0.0.1:8888; | |
} | |
server { | |
root /var/www/foobar/; | |
index index.html; | |
server_name test.foobar.org; | |
access_log /var/log/nginx/foobar.access.log; | |
error_log /var/log/nginx/foobar.error.log; | |
location = / { | |
proxy_pass http://$backend; | |
} | |
location / { | |
proxy_pass http://$everything; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment