mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5108] [Question]: 3rd level domain #3586
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3586
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MahdiMz80 on GitHub (Jun 9, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5108
What are you trying to do?
In the initial installation of the panel using the install.sh, I did set a 3rd level domain as the domain for usage (s-vn.haji.pp.ua) and gave the path for the cert files that were gotten using certbot from let's encrypt (etc/letsencrypt/live/...), for the 2nd level domain itself and its any 3rd level subdomains as wildcard (haji.pp.ua, *.haji.pp.ua)
After the setup, I noticed the option 10 of x-ui shows the access address as haji.pp.ua instead of s-vn.haji.pp.ua.
Meanwhile I could have accessed the panel via s-vn.haji.pp.ua, Ihad multiple of random timeouts on both panel and sub webpages, along with ssl handshake timeouts visible in the debug logs (restarting the panel and xray via cli was sometimes solving the timeout at reaching panel/sub temporarily, probably until doing any edition in the panel that needed xray restarting [not sure] - restarting xray from the panel wasn't solving anything)
The main problem was that any kind of inbounds i made, clients were unable to connect to the internet using them.
Despite it showing s-vn.haji.pp.ua as the address in the configs, I was curious if x-ui is probably building the configs on haji.pp.ua instead of s-vn.haji.pp.ua (just like it shows it as the access url) hence why none of configs I made worked.
I thought it might also be related to how I've configured my domain and its certificate, but everything seems to be done correctly, that's why I thought it might be related on how x-ui handles the 3rd level domains wrongly.
(Additionally if there's any community of users, would be nice if you gimme its details as well)
What have you already tried?
Uninstalled x-ui totally and reinstalled by configuring the ip address instead of adding any domain (also got ssl for ip using the installation script itself) and now my clients seem to have connection to the internet using the same inbounds.
3x-ui version
3.2.8
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Screenshots or config snippets
No response
Before submitting
@github-actions[bot] commented on GitHub (Jun 9, 2026):
Thanks for the detailed report. I traced this through the source to give you a precise answer.
What you're seeing in option 10 (View Settings)
The display of the Access URL in the
x-uimanagement menu (option 10 →check_config()inx-ui.sh, line 363) derives the domain name by doing:It takes the parent directory name of your cert file path. If your cert path is
/etc/letsencrypt/live/haji.pp.ua/fullchain.pem, thendirnamegives/etc/letsencrypt/live/haji.pp.uaandbasenamegiveshaji.pp.ua— so it always shows the cert-directory name, regardless of which subdomain you actually use to access the panel.This is a known cosmetic bug (see related #5070). It only affects the display in the CLI menu.
Does x-ui use the wrong domain for inbound configs?
No. The Xray inbound configurations are built entirely from the settings you explicitly set when creating each inbound in the web panel. There is no logic anywhere in the codebase that reads the cert file path to inject a domain into inbound configs. Whatever address you entered in the inbound form is what goes into the client configs.
Why the panel/sub page timeouts?
The panel's domain filter (
webDomainsetting, used inDomainValidatorMiddleware) defaults to an empty string and is never set byx-ui certor the installation flow. When it's empty, the middleware is not installed (seeweb/web.goline 160–162), so requests tos-vn.haji.pp.uaare not rejected at the HTTP layer.The SSL timeouts you observed are more likely explained by one or more of these factors:
updateCertinmain.goapplies the same cert/key to both the panel and the subscription server (SetSubCertFile/SetSubKeyFile). If the cert or key file was not readable (e.g. Let's Encrypt certs in/etc/letsencrypt/live/default to root-only permissions), TLS would fail to load and fall back to HTTP, causing handshake errors from clients expecting HTTPS.haji.pp.ua+*.haji.pp.uacoverss-vn.haji.pp.uaat one level deep. If any inbound usedhaji.pp.uaas aserverNamein its TLS/REALITY settings, that is correct; no issue there.What actually fixed it for you
Reinstalling with IP address avoids any DNS/subdomain resolution step, so connectivity issues that were DNS-related or cert-path-related would disappear. The inbound functionality is identical regardless of whether you use a domain or IP.
If you want to keep using
s-vn.haji.pp.uachmod 644 /etc/letsencrypt/live/haji.pp.ua/fullchain.pem /etc/letsencrypt/live/haji.pp.ua/privkey.pemor copy them to/root/cert/s-vn.haji.pp.ua/).haji.pp.uain option 10 is harmless — the panel is fully accessible vias-vn.haji.pp.ua.@rqzbeh commented on GitHub (Jun 9, 2026):
Wild card cert can only be get by dns based method and not http based.
Panel itself can only get wildcard cert from cloudflare using API (option 20)
For manual wildcard certification try this:
https://community.letsencrypt.org/t/dns-label-for-wildcard-certificate-validation/50415
@MahdiMz80 commented on GitHub (Jun 9, 2026):
I mean getting the certificate is not an issue, I own haji.pp.ua domain, so I have it added in cloudflare dashboard, and already got a certificate for haji.pp.ua and *.haji.pp.ua.
My problem is that none of the inbounds worked after I had set s-vn.haji.pp.ua while installing the panel, and I can't figure out what was causing that exactly.
Do I need to skip ssl certificate and install based on IP address, then just move my certificate from let's encrypt's path to the root certificate path that x-ray scans and try adding the domain from there instead?
Additionally if anyone is experienced enough with this, I'll happily give access to my domain to try if it's basically possible to do with this kind of 3rd level domains or not (or maybe I'm doing something wrong but at least I'll know if I'm trying for nothing or not)
@MHSanaei commented on GitHub (Jul 3, 2026):
To answer the core question: no — 3x-ui never builds inbound or share configs from the certificate path. The address in generated configs comes only from what you set on the inbound (or the request host), so third-level domains like
s-vn.haji.pp.uaare fully supported, and a wildcard*.haji.pp.uacertificate covers them. The domain shown in menu option 10 is informational only — it's derived from the certificate folder name and its SANs (improved in #5070) and has no effect on Xray configs.The connection problems you saw are most likely file permissions on the Let's Encrypt cert/key (copy them somewhere readable, e.g.
/root/cert/<domain>/, and point the panel there) or a port shared between the panel/sub server and an inbound.Closing as answered; feel free to open a new question with panel logs if it recurs.