-
Notifications
You must be signed in to change notification settings - Fork 2
/
proxy.conf.js
40 lines (38 loc) · 1.04 KB
/
proxy.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const BASE_URL = process.env.BASE_URL || 'http://localhost:8080';
const IDENTITY_SERVICE_URL = process.env.IDENTITY_SERVICE_URL || process.env.BASE_URL || 'http://localhost:3000';
console.info(`ACS URL: ${BASE_URL}`);
console.info(`IDENTITY URL: ${IDENTITY_SERVICE_URL}`);
module.exports = {
'/alfresco': {
target: BASE_URL,
pathRewrite: {
'^/alfresco/alfresco': ''
},
secure: false,
changeOrigin: true,
onProxyReq: function (request) {
if (request['method'] !== 'GET') {
request.setHeader('origin', BASE_URL);
}
},
// workaround for REPO-2260
onProxyRes: function (proxyRes) {
const header = proxyRes.headers['www-authenticate'];
if (header?.startsWith('Basic')) {
proxyRes.headers['www-authenticate'] = 'x' + header;
}
}
},
'/auth': {
target: IDENTITY_SERVICE_URL,
secure: false,
logLevel: 'debug',
changeOrigin: 'true'
},
'/search': {
target: 'http://localhost:8081',
secure: false,
logLevel: 'debug',
changeOrigin: 'true'
}
};