Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
laptopwiki:guides:docker:meshcentral [29/07/2023 23:50] – [Deploying container] dustojnikhummer | laptopwiki:guides:docker:meshcentral [12/01/2024 21:14] (current) – [If Cloudflare Proxy] dustojnikhummer | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Mesh Central in Docker behind NGINX Proxy Manager Reverse Proxy ====== | ====== Mesh Central in Docker behind NGINX Proxy Manager Reverse Proxy ====== | ||
* What is Nginx Proxy Manager (also known as NPM): [[https:// | * What is Nginx Proxy Manager (also known as NPM): [[https:// | ||
- | * What is Mesh Central: https:// | + | * What is Mesh Central: |
+ | * Container we will be using, including base of my docker-compose.yml: | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | ====== Prerequisites ====== | ||
+ | - Docker environment on Linux | ||
+ | - Portainer, docker-compose installed | ||
+ | - Ports 80/443 port forwarded to your Docker host | ||
+ | - Reverse proxy being Nginx Proxy Manager, not Traefik as I don't use it | ||
+ | - Nginx Proxy Manager listening for ports 80/443 | ||
===== Deploying container ===== | ===== Deploying container ===== | ||
* We will be using an unofficial, but as of writing this article still maintained and community approved, Docker version of Mesh Central | * We will be using an unofficial, but as of writing this article still maintained and community approved, Docker version of Mesh Central | ||
Line 62: | Line 73: | ||
* For example, TZ=Europe/ | * For example, TZ=Europe/ | ||
* Storage mounts (I had issues with MeshCentral Volume paths, so that is why I'm using volumes) | * Storage mounts (I had issues with MeshCentral Volume paths, so that is why I'm using volumes) | ||
- | * ALLOW_NEW_ACCOUNTS=false, | + | * ALLOW_NEW_ACCOUNTS=false, |
+ | |||
+ | ===== Config File ===== | ||
+ | * You will find the config file in the container' | ||
+ | * Since I used a Docker Volume, I can use Portainer to see where that is mounted on my server' | ||
+ | * {{: | ||
+ | * Open the config.json file with < | ||
+ | * If this is your initial installation, | ||
+ | * Modify it according to this example, changing stuff like your FQDN | ||
+ | < | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | "": | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * Note: I did not touch the letsencrypt section here at all, since we are handling our SSL certificate elsewhere | ||
+ | ==== So what are we changing and why? ==== | ||
+ | * TLDR: | ||
+ | * Mesh Central uses a self signed certificate to talk to clients. | ||
+ | * Since ours is behind NPM it can't communicate directly and hashes won't match. | ||
+ | * We need to tell it to instead use NPM's certificate | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | * Save the file (Press Ctrl+O and Enter to save changes and Ctrl+X to exit Nano) | ||
+ | * Restart the container | ||
+ | |||
+ | ===== NGINX Proxy Manager ===== | ||
+ | - Add a new Proxy host as you would with any other Docker container \\ {{: | ||
+ | - Don't forget to check **Websockets Support** | ||
+ | - In SSL select your certificate, | ||
+ | - In the **Advanced** tab paste the following | ||
+ | < | ||
+ | proxy_set_header CF-Connecting-IP $proxy_add_x_forwarded_for; | ||
+ | proxy_set_header X-Forwarded-Host $host: | ||
+ | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | proxy_set_header X-Forwarded-Proto $scheme; | ||
+ | </ | ||
+ | ===== If Cloudflare Proxy ===== | ||
+ | * As of August 2023, MeshCentral no longer works through Cloudflare Proxy, see [[https:// | ||
+ | - < | ||
+ | - < | ||
+ | - < | ||
+ | |||
+ | ===== Issues ===== | ||
+ | ==== Unable to connect web socket ==== | ||
+ | - If you get this error after logging into the Mesh Central WebUI do: | ||
+ | - Go to NPM | ||
+ | - In Proxy Host -> your Mesh Central Host -> Check **Websockets Support** | ||
+ | |||
+ | --- // |