Skip to content

Commit

Permalink
#481 Use root_path for proxy rewrites
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed Oct 30, 2024
1 parent faebb87 commit 8df47cd
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions adjacent-servers/adjacent-servers-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ function initAdjacentServersProxy(app, isDocker, ensureAdmin) {
process.env.STAC_PORT || 8881
}`,
changeOrigin: true,
pathRewrite: { "^/stac": "" },
pathRewrite: {
[`^${
(process.env.EXTERNAL_ROOT_PATH || "") +
(process.env.ROOT_PATH || "")
}/stac`]: "",
},
selfHandleResponse: true,
on: {
proxyRes: createSwaggerInterceptor("stac"),
Expand All @@ -35,7 +40,12 @@ function initAdjacentServersProxy(app, isDocker, ensureAdmin) {
process.env.TIPG_PORT || 8882
}`,
changeOrigin: true,
pathRewrite: { "^/tipg": "" },
pathRewrite: {
[`^${
(process.env.EXTERNAL_ROOT_PATH || "") +
(process.env.ROOT_PATH || "")
}/tipg`]: "",
},
selfHandleResponse: true,
on: {
proxyRes: createSwaggerInterceptor("tipg"),
Expand All @@ -54,7 +64,12 @@ function initAdjacentServersProxy(app, isDocker, ensureAdmin) {
process.env.TITILER_PORT || 8883
}`,
changeOrigin: true,
pathRewrite: { "^/titiler": "" },
pathRewrite: {
[`^${
(process.env.EXTERNAL_ROOT_PATH || "") +
(process.env.ROOT_PATH || "")
}/titiler`]: "",
},
selfHandleResponse: true,
on: {
proxyRes: createSwaggerInterceptor("titiler"),
Expand All @@ -73,7 +88,12 @@ function initAdjacentServersProxy(app, isDocker, ensureAdmin) {
process.env.TITILER_PGSTAC_PORT || 8884
}`,
changeOrigin: true,
pathRewrite: { "^/titilerpgstac": "" },
pathRewrite: {
[`^${
(process.env.EXTERNAL_ROOT_PATH || "") +
(process.env.ROOT_PATH || "")
}/titilerpgstac`]: "",
},
selfHandleResponse: true,
on: {
proxyRes: createSwaggerInterceptor("titilerpgstac"),
Expand Down

0 comments on commit 8df47cd

Please sign in to comment.