Skip to content

Hide the master address

With only a master domain, regular users can learn the master address in three places:

  • QR sign-in: the host in the QR code / sign-in link is the master domain.
  • Fetching subscriptions: when the official client fetches a subscription, the response carries the realtime channel address (mmwx-realtime-url) — also the master domain.
  • Opening the panel on the subscription domain: with “Disable public access” on, it redirects to the master domain.

Once a separate subscription domain is set up (master v0.6.4-beta.3 and later), all three switch to the subscription domain, so regular users only ever deal with the subscription domain. Admins are not affected and keep using the master domain.

Situation Regular users Admins
QR sign-in, “Open client”, “Copy sign-in link” Subscription domain Master domain
Account sign-in in the client (address typed by hand) Enter the subscription domain Enter the master domain
Realtime channel address in subscription responses Subscription domain Subscription domain
Opening the panel or any non-subscription path on the subscription domain 404, no redirect 404, no redirect

With the user portal on, regular users also use the web panel on the subscription domain, so you never need to give them the master domain. Turn on “Don’t let regular users sign in on the panel domain” as well and regular users can only sign in through the subscription domain.

  1. A subscription domain is set and differs from the master domain: System Settings → “System” → “Subscription URL”.
  2. The subscription domain serves the client encryption endpoints: /api/secure/cert, /api/secure/rpc and /api/secure/ws (WebSocket) must all reach the master from the internet through port 443 of the subscription domain.
    • If the master configured the subscription domain’s Nginx: click Reconfigure Nginx on the subscription domain’s HTTPS reverse proxy card (configs generated by older versions don’t pass these three paths; the card shows “The Nginx config doesn’t match the current setting”).
    • If you maintain Nginx / Caddy / Cloudflare rules yourself: add them as in Subscription domain · Manual configuration.
  3. The license is activated: client certificates are issued per domain by the license service. The subscription domain and the master domain each get one, signed for two different keys, so a client can’t tell from the certificates that both domains belong to the same master.

The master requests all three endpoints on the subscription domain from the outside and switches only when all of them work, then re-checks every 10 minutes:

  • While they don’t work, regular users keep getting the master domain (so QR sign-in doesn’t break), and the check tells you why.
  • For the first few seconds after the master restarts, before the first result is in, subscription responses carry no realtime channel address (the client picks it up on its next fetch) rather than falling back to the master domain.

Changing panel settings isn’t enough. If any of these three is missing, the master address can still be found from the subscription domain:

Requirement Why How
The subscription domain must not resolve to the master’s IP The DNS answer itself is the master’s IP; knowing the IP finds the master Put the subscription domain behind a CDN proxy (e.g. Cloudflare’s orange cloud), or put a front server in front that reverse-proxies to the master
The subscription domain uses a different parent domain Certificate Transparency logs (e.g. crt.sh) list every subdomain that ever got a certificate under a parent domain: look up sub.example.com and panel.example.com is right there For example, master on panel.example.com, subscriptions on sub.another.net
The subscription domain has its own certificate The certificate is public during the TLS handshake: a wildcard certificate covering the master (*.example.com), or a multi-domain certificate listing the master domain, shows it to anyone who connects Issue a separate certificate for the subscription domain in Certificates

When using a front server, keep the Host header as the subscription domain when forwarding to the master: the master recognizes the subscription domain by Host to serve the matching certificate and allow the matching paths.

System Settings → “System” → the 隐藏主控地址检查 card (hide master address check; the card is only in Chinese for now) → click 开始检查 (start check). The check sends requests from the master to the outside (probing the subscription domain, looking up the master’s public IP), so it only runs when you click it, never automatically with the page.

The first line shows the current state:

  • 生效中 (active): regular users’ QR sign-in and realtime channel already use the subscription domain.
  • 未生效 (not active): regular users still use the master domain; see which item below failed.
Item When it fails
独立订阅域名 (separate subscription domain) No subscription domain, it’s an IP, or it equals the master domain
订阅域名提供客户端加密接口 (serves client encryption endpoints) One of the three endpoints doesn’t work; the message says which one and what it returned — see FAQ
与主控不同主域名 (different parent domain) Both share a parent domain (warning)
订阅域名不解析到主控 IP (doesn’t resolve to the master IP) The subscription domain resolves to the master’s public IP
订阅域名证书不含主控域名 (certificate doesn’t cover the master domain) The certificate on port 443 of the subscription domain covers the master domain
  • Regular users: in the web panel, avatar menu → “QR login”; the QR code already carries the subscription domain, just scan it. For account sign-in, enter the subscription domain as the “Master address”, e.g. https://sub.another.net.
  • Admins: the QR code carries the master domain; for account sign-in, enter the master domain. With the user portal on, admins can’t sign in on the subscription domain (same as the web, with the same reply as a wrong password).

See Client sign-in for the details of each sign-in method.

  • TG Mini App: the user page moves to the subscription domain only with the user portal on; otherwise the Mini App still opens from the master domain.
  • Regular users signing in to the web on the master domain: if you give them the master address, they obviously know it. Use the user portal and turn on “Don’t let regular users sign in on the panel domain”.
  • Nodes on the same machine as the master: the node address is that machine’s IP, which is in the subscription anyway. To separate them fully, don’t run nodes on the master.

The check says the endpoint “返回 HTTP 404” (returned 404) and the reverse proxy doesn’t pass /api/secure/*

Section titled “The check says the endpoint “返回 HTTP 404” (returned 404) and the reverse proxy doesn’t pass /api/secure/*”

The reverse proxy only forwards subscription paths. If the master manages Nginx, click Reconfigure Nginx; otherwise add the three endpoints as in Subscription domain · Manual configuration. /api/secure/ws needs WebSocket forwarding (Upgrade / Connection headers).

The check says “返回 HTTP 503: …too many requests”

Section titled “The check says “返回 HTTP 503: …too many requests””

The license service is rate-limiting for a moment (for example, after the master restarted several times in a row), so the certificate wasn’t issued yet. Wait a minute or two and click 重新检查 (check again).

The check says the certificate “不是本主控订阅域名那套” (isn’t this master’s subscription domain certificate)

Section titled “The check says the certificate “不是本主控订阅域名那套” (isn’t this master’s subscription domain certificate)”

The subscription domain’s reverse proxy points to a different master, or the CDN origin isn’t this master. Fix the origin and check again.

Regular users still get the master domain after the change

Section titled “Regular users still get the master domain after the change”

The switch waits for the probe to pass: clicking 重新检查 (check again) re-probes immediately. QR codes that were already generated don’t change — close the dialog and generate a new one.