Created
April 16, 2013 22:13
-
-
Save BugRoger/5400104 to your computer and use it in GitHub Desktop.
Service Gateway in nginx
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
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