Updated Configuring Multiple Servers (markdown)

James Lyne 2022-05-31 12:13:18 +01:00
parent 3b2f6cacbd
commit 1da0a51ace

@ -34,7 +34,9 @@ This subdirectory-based approach was chosen for its relative simplicity and beca
LiveAtlas needs to be accessible via the URLs of all servers you wish to use. For example if you want your server maps to be accessible via `https://example.com/map/<servername>` with servers named `creative` and `survival`, you will need to ensure LiveAtlas is accessible via `https://example.com/map/survival` and `https://example.com/map/creative`. LiveAtlas needs to be accessible via the URLs of all servers you wish to use. For example if you want your server maps to be accessible via `https://example.com/map/<servername>` with servers named `creative` and `survival`, you will need to ensure LiveAtlas is accessible via `https://example.com/map/survival` and `https://example.com/map/creative`.
A simple way to do this is to host LiveAtlas at `https://example.com/map/` (note the trailing `/`) and configure your webserver to route requests for nonexistant files to LiveAtlas' index.html. The below example for nginx routes requests to non-existant files for `/map/` URLs to LiveAtlas: A simple way to do this is to host LiveAtlas at `https://example.com/map/` (note the trailing `/`) and configure your webserver to route requests for nonexistant files to LiveAtlas' index.html.
Here is a an nginx configuration example which routes requests to non-existant files for `/map/` URLs to LiveAtlas:
location ~ ^/map/ { location ~ ^/map/ {
index index.html; index index.html;
@ -50,6 +52,13 @@ This subdirectory-based approach was chosen for its relative simplicity and beca
} }
} }
An apache example, which should be in an .htaccess file within `/map`:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
FallbackResource /index.html
2. Configure LiveAtlas for multiple servers 2. Configure LiveAtlas for multiple servers
Multiple server support is configured in index.html. Look for the `<script>` containing the `window.liveAtlasConfig` object and edit the `servers` property to include the servers you want to be accessible within LiveAtlas. The key of each server object will be used in the URL to access it. Multiple server support is configured in index.html. Look for the `<script>` containing the `window.liveAtlasConfig` object and edit the `servers` property to include the servers you want to be accessible within LiveAtlas. The key of each server object will be used in the URL to access it.