Skip to content

Instantly share code, notes, and snippets.

@nxvipin
Last active September 26, 2019 19:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nxvipin/22f604d5e2950c97cad2fe8e3ff4598b to your computer and use it in GitHub Desktop.
Save nxvipin/22f604d5e2950c97cad2fe8e3ff4598b to your computer and use it in GitHub Desktop.
upstream p1 {
server foo.com;
}
upstream p2 {
server bar.com;
}
# Select upstream based on the value of query parameter `product`
map $arg_product $profile{
default "p1";
foo "p1";
bar "p2";
}
server {
location /foobar {
proxy_pass http://$profile;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment