Skip to content

Instantly share code, notes, and snippets.

@johnmarinelli
Created December 23, 2015 19:11
Show Gist options
  • Save johnmarinelli/cbfcf3a60b3e31a90035 to your computer and use it in GitHub Desktop.
Save johnmarinelli/cbfcf3a60b3e31a90035 to your computer and use it in GitHub Desktop.
nginx conf file
events { worker_connections 1024; }
http {
upstream roundrobin {
# roundrobin is enabled by default
server google.com;
server msn.com;
server yahoo.com;
}
upstream iphash {
ip_hash;
server google.com;
server msn.com;
server yahoo.com;
}
upstream generichash {
hash $request_uri consistent;
server google.com;
server msn.com;
server yahoo.com;
}
server {
listen 80;
location / {
proxy_pass http://roundrobin;
}
location /iphash/ {
proxy_pass http://iphash;
}
location /generichash/ {
proxy_pass http://generichash;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment