-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathproxy.conf.js
More file actions
34 lines (29 loc) · 817 Bytes
/
proxy.conf.js
File metadata and controls
34 lines (29 loc) · 817 Bytes
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
/** FQDN to proxy requests. i.e. No protocol and path should be in the value */
const domain = 'placeos-dev.aca.im';
/** Whether the proxied endpoints use SSL */
const secure = true;
/** Whether the SSL certificate used is valid on the internet */
const valid_ssl = true;
const PROXY_CONFIG = {};
const context = [
'/control',
'/auth',
'/api',
'/styles',
'/scripts',
'/login',
'/backoffice',
'/r',
];
const ws_context = ['/control/websocket', '/api'];
function add(endpoint, extras = {}) {
PROXY_CONFIG[`${endpoint}/**`] = {
target: `http${secure ? 's' : ''}://${domain}`,
secure: valid_ssl,
changeOrigin: true,
...extras,
};
}
context.forEach((e) => add(e));
ws_context.forEach((e) => add(e, { ws: true }));
module.exports = PROXY_CONFIG;