[GH-ISSUE #6721] [Question]: using multi domain name to panel login. #4479

Open
opened 2026-10-31 20:39:56 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Matin4359 on GitHub (Oct 3, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6721

What are you trying to do?

Hi, using multi domain name to panel login, possible?

What have you already tried?

No response

3x-ui version

3.9.0

How did you install 3x-ui?

install.sh script

Operating system

No response

Screenshots or config snippets

No response

Before submitting

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
Originally created by @Matin4359 on GitHub (Oct 3, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6721 ### What are you trying to do? Hi, using multi domain name to panel login, possible? ### What have you already tried? _No response_ ### 3x-ui version 3.9.0 ### How did you install 3x-ui? install.sh script ### Operating system _No response_ ### Screenshots or config snippets _No response_ ### Before submitting - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 3, 2026):

Yes. To open the panel on several domain names, leave Listen Domain empty and point all of your domains (DNS A/AAAA records) at the server. With the field empty, the panel accepts requests for any host name. If you set it, the panel accepts only that one exact host name.

Why

Panel Settings → General → Listen Domain (setting key webDomain) holds a single host name, not a list. When it is set, the panel installs a middleware that rejects every other Host with HTTP 403:

internal/web/web.go:189-191

if webDomain != "" {
    engine.Use(middleware.DomainValidatorMiddleware(webDomain))
}

internal/web/middleware/domainValidator.go

if host != domain {
    c.AbortWithStatus(http.StatusForbidden)
    return
}

So you cannot enter several domains there (for example comma-separated), because the whole string is compared to the request host as is. The field's own description says the same thing: "leave blank to listen on all domains and IPs" (internal/web/translation/en-US.json:1266).

If you use HTTPS on the panel

The panel loads exactly one certificate/key pair (Panel Certificate Public Key File Path / Private Key File Path; tls.LoadX509KeyPair(certFile, keyFile) in internal/web/web.go:622). To avoid browser warnings on every domain, that certificate must cover all of them. That means a multi-domain (SAN) certificate or a wildcard certificate, issued with all names included.

Steps

  1. Point each domain's DNS record at the server's IP.
  2. In Panel Settings → General, clear Listen Domain, save, and restart the panel.
  3. If you use TLS, issue one certificate that includes every domain, and set its paths in the panel certificate fields.
  4. If the panel is behind a reverse proxy (nginx, Caddy), add all the domains to that proxy's server_name / site block instead.

Some other features read webDomain as the panel's public host. For example, the subscription host falls back to it when subDomain is empty (internal/sub/service.go:266). If you clear it and want subscription links to show a fixed domain, set the subscription Reverse Proxy URI. The subscription's own Listen Domain would also limit the subscription server to that single host.

Verdict: Not a bug (expected behaviour). This is a usage question: Listen Domain accepts one host, and leaving it empty allows all domains.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:5968953475 --> @github-actions[bot] commented on GitHub (Oct 3, 2026): Yes. To open the panel on several domain names, **leave `Listen Domain` empty** and point all of your domains (DNS A/AAAA records) at the server. With the field empty, the panel accepts requests for any host name. If you set it, the panel accepts only that one exact host name. **Why** `Panel Settings → General → Listen Domain` (setting key `webDomain`) holds a single host name, not a list. When it is set, the panel installs a middleware that rejects every other `Host` with HTTP 403: `internal/web/web.go:189-191` ```go if webDomain != "" { engine.Use(middleware.DomainValidatorMiddleware(webDomain)) } ``` `internal/web/middleware/domainValidator.go` ```go if host != domain { c.AbortWithStatus(http.StatusForbidden) return } ``` So you cannot enter several domains there (for example comma-separated), because the whole string is compared to the request host as is. The field's own description says the same thing: *"leave blank to listen on all domains and IPs"* (`internal/web/translation/en-US.json:1266`). **If you use HTTPS on the panel** The panel loads exactly one certificate/key pair (`Panel Certificate Public Key File Path` / `Private Key File Path`; `tls.LoadX509KeyPair(certFile, keyFile)` in `internal/web/web.go:622`). To avoid browser warnings on every domain, that certificate must cover all of them. That means a multi-domain (SAN) certificate or a wildcard certificate, issued with all names included. **Steps** 1. Point each domain's DNS record at the server's IP. 2. In `Panel Settings → General`, clear `Listen Domain`, save, and restart the panel. 3. If you use TLS, issue one certificate that includes every domain, and set its paths in the panel certificate fields. 4. If the panel is behind a reverse proxy (nginx, Caddy), add all the domains to that proxy's `server_name` / site block instead. Some other features read `webDomain` as the panel's public host. For example, the subscription host falls back to it when `subDomain` is empty (`internal/sub/service.go:266`). If you clear it and want subscription links to show a fixed domain, set the subscription `Reverse Proxy URI`. The subscription's own `Listen Domain` would also limit the subscription server to that single host. Verdict: Not a bug (expected behaviour). This is a usage question: `Listen Domain` accepts one host, and leaving it empty allows all domains. *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
Author
Owner

@Matin4359 commented on GitHub (Oct 3, 2026):

Yea I know, but I can't figure out how to resolve the certificate problem. for direct connection, not proxy like Cloudflare.

<!-- gh-comment-id:5973473262 --> @Matin4359 commented on GitHub (Oct 3, 2026): Yea I know, but I can't figure out how to resolve the certificate problem. for direct connection, not proxy like Cloudflare.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#4479
No description provided.