Skip to content
Permalink
Browse files

tweaked proxy configuration to split some services to different hosts

  • Loading branch information...
hrovira committed Nov 16, 2012
1 parent e9dbe01 commit 98adc05e6445e631e6af804326312f7cb27cc8a9
Showing with 11 additions and 2 deletions.
  1. +8 −2 proxy.json
  2. +3 −0 server.js
@@ -1,10 +1,16 @@
{
"proxy":[
{
"url":"/svc",
"url":"/svc/pw_lookups",
"rewrite_url":"http://genespot.cancerregulome.org",
"host":"genespot.cancerregulome.org",
"port": 80
"port": 80,
"keep_url": true
},
{
"url":"/svc",
"host":"localhost",
"port": 8000
},
{
"url":"/graph_layout",
@@ -48,6 +48,9 @@ exports.startServer = function(port, path) {
target["port"] = proxyConfig.port;

if (proxyConfig.rewrite_url) {
if (!proxyConfig.keep_url) {
req.url = req.url.slice(proxyConfig.url.length);
}
req.url = proxyConfig.rewrite_url + req.url;
proxy.proxyRequest(req, res, target);
return;

0 comments on commit 98adc05

Please sign in to comment.
You can’t perform that action at this time.