Skip to content

Instantly share code, notes, and snippets.

@BugRoger
Created April 16, 2013 22:13
Show Gist options
  • Save BugRoger/5400104 to your computer and use it in GitHub Desktop.
Save BugRoger/5400104 to your computer and use it in GitHub Desktop.
Service Gateway in nginx
upstream fire {
server localhost:8081;
}
upstream warehouse {
server localhost:8082;
}
upstream authority {
server localhost:8083;
}
server {
location ~ ^/api/(instances/buckets)/? {
rewrite ^/api(.*)$ $1 break;
proxy_pass http://fire;
}
location ~ ^/api/(repositories)/? {
rewrite ^/api(.*)$ $1 break;
proxy_pass http://warehouse;
}
location ~ ^/api/(users/keys/permissions)/? {
rewrite ^/api(.*)$ $1 break;
proxy_pass http://authority;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment