From bad6f83494beac0539c7d48a87506e1cd2a9e985 Mon Sep 17 00:00:00 2001 From: utchoang Date: Mon, 26 Jul 2021 09:16:09 +0700 Subject: [PATCH] User documentation for configuring config, proxy/server to allow Cloudstack to use multiple servers --- ui/docs/multiple-management-server.md | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 ui/docs/multiple-management-server.md diff --git a/ui/docs/multiple-management-server.md b/ui/docs/multiple-management-server.md new file mode 100644 index 000000000000..56d67b225e84 --- /dev/null +++ b/ui/docs/multiple-management-server.md @@ -0,0 +1,50 @@ +# Multiple Management Server +Use file `public/config.json` (or `dist/config.json` after build) to configure the settings which allow Cloudstack to support multiple servers. + +## Setting `config.json` +``` +"servers": [ + { + "name": "server01", + "apiHost": "/server01", + "apiBase": "/client/api" + }, + { + "name": "server02", + "apiHost": "", + "apiBase": "/client/api" + } + ], +"multipleServer": true +``` +- `multipleServer` configure to allow Cloudstack to support multiple servers. +- `servers` list of servers to which Cloudstack can connect. + +## Nginx config +Example: Use following settings in `config.json` so that user's GUI can work with different servers (to be put into /etc/nginx/conf.d/default/conf or similar): + +``` +server { + listen 80; + server_name localhost; + + location / { + # /src/ui/dist contains the built UI webpack + root /src/ui/dist; + index index.html; + } + + # for apiHost of server01 located in config.json + location /server01/client/ { + rewrite ^/server01/(.*)$ /$1 break; + # server's actual URI + proxy_pass https://server01.your.domain; + } + + # for apiHost of server02 located in config.json + location /client/ { + # server's actual URI + proxy_pass https://server02.your.domain; + } +} +```