Help · Getting started

Choosing HTTPS

The three ways to serve the panel over HTTPS (Let's Encrypt, the server's own certificate, or your own reverse proxy), what each needs, and how to switch later.

Last updated

The panel only works over HTTPS: signing in, and Microsoft's sign-in and consent pages, need it. The installer asks how to do it, with three choices.

Choice Pick it when What staff see
auto: a free Let's Encrypt certificate The hostname is in public DNS and the server can be reached from the internet on ports 80 and 443 A trusted certificate, renewed by itself
internal: a certificate from the server itself The hostname is only used inside your network A certificate warning, until you trust the server's root certificate on their PCs
proxy: your own reverse proxy You already run nginx, Nginx Proxy Manager, Traefik, HAProxy, a Cloudflare Tunnel or similar Whatever certificate your proxy has

auto is the best choice when you can use it.

auto: Let's Encrypt #

  1. Point the hostname at the server's public address in DNS (an A record).
  2. Open TCP 80 and 443 to the server from the internet. Port 80 is needed for Let's Encrypt to check the name.
  3. In the installer, choose auto (or run it with --https auto). Give an email address when asked, for Let's Encrypt's expiry warnings.

The certificate is fetched as soon as the name points at the server, and renewed by itself. If the panel isn't answering with a trusted certificate yet, run sudo mygration doctor: it says what's missing.

internal: the server's own certificate #

For a name such as mygration.corp.local that only resolves inside your network. Choose internal in the installer (or --https internal).

Browsers warn about the certificate until the server's root certificate is trusted on staff PCs. Copy it off the server:

sudo docker compose -f /opt/mygration/docker-compose.yml cp proxy:/data/caddy/pki/authorities/local/root.crt mygration-root.crt

Then trust mygration-root.crt on the PCs that need the panel, with Group Policy or Intune, say.

Important

That root certificate isn't limited to the panel's name: anyone who got its private key off the server could make a certificate for any website, and those PCs would trust it. Keep the server locked down, and trust the root only on the PCs that need the panel. Prefer auto, or a certificate from your organisation's own certificate authority behind your own reverse proxy.

Workers at customers' sites need the same root certificate: see Running a worker at a customer's site.

proxy: your own reverse proxy #

Choose proxy in the installer (or --https proxy). The panel then answers plain HTTP on http://127.0.0.1:8080, on the server itself only, and your proxy does HTTPS. Set your proxy up like this:

  1. Send https://<hostname> to http://127.0.0.1:8080, with a certificate for the hostname.

  2. Pass on the original address and scheme. Keep the Host header and send X-Forwarded-Proto (https) and X-Forwarded-For. Without them the panel thinks it's on plain HTTP, and signing in fails. In nginx:

    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    Nginx Proxy Manager, Traefik, Caddy and Cloudflare Tunnels send them by themselves.

  3. Allow large requests and long answers. CSV imports and backup downloads can be big, and some pages wait on Microsoft. In nginx:

    client_max_body_size 50m;
    proxy_read_timeout 300s;

A proxy on the same server works as it is: the installer sets the panel to believe its forwarded headers.

A proxy on another machine #

When you pick proxy, the installer asks where your proxy runs. Choose on another machine, then:

  1. Pick this server's address your proxy reaches it on (it suggests the main one) and the port (8080 unless you change it).
  2. Enter your proxy's IP address, or several separated by commas. The panel believes forwarded addresses from these only.
  3. At the end, the installer says where to point your proxy: http://<this server's address>:<port>, keeping the Host header.
  4. Let only the proxy through to that port. Docker's ports aren't covered by ufw, so use your network's firewall, or the rule in the installer's output.

Unattended, give it all at once:

sudo bash install.sh --https proxy --proxy-on other --trusted-proxy 10.0.40.5 --hostname mygration.brightpathit.example

To change it on a server that's already installed, run the same with --repair in place of the hostname, or edit PANEL_BIND, PANEL_PORT and PANEL_TRUSTED_PROXIES in /opt/mygration/.env and run sudo mygration start.

sudo mygration doctor shows where the panel listens, and warns when the proxy settings don't match.

Important

PANEL_TRUSTED_PROXIES=* believes anyone's forwarded headers. Use it only when nothing but your proxy can reach the port.

Switching later #

Download the installer again and run it with the mode you want. It finds the install, keeps everything, and switches HTTPS:

curl -fsSL --proto '=https' --proto-redir '=https' --tlsv1.2 https://mygration.cloud/install.sh -o install.sh
sudo bash install.sh --repair --https auto

Use --https internal or --https proxy for the others. For auto, give --email <address> too if you want Let's Encrypt's warnings.

Certificate warnings #

Mode Likely cause
auto Let's Encrypt hasn't issued the certificate yet: the hostname doesn't point at the server, or 80 and 443 aren't open from the internet. Run sudo mygration doctor.
internal The server's root certificate isn't trusted on that PC yet.
proxy Your proxy's certificate. If signing in goes round in circles, the proxy isn't passing X-Forwarded-Proto and Host.