[GH-ISSUE #5309] [Feature]: Different domain for panel and inbound #3720

Closed
opened 2026-10-31 20:34:28 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Michael-YS on GitHub (Jun 14, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5309

As of right now, the link and qr code generated are based upon the domain for the panel. In cases where panel url isn't the same as inbound url (for example: access via tailscale or ssh port forwarding), the address in the link/qr code isn't aligned with the actual inbound domain.
For example:
Deploy an 3x-ui on a machine, and access the panel via ssh port forwarding. When import via link or qr code in the client, the destination is shown as 127.0.0.1 instead of the real domain name for the server.

Describe the solution you'd like

Add a field in the config page to specify this "inbound domain name", which will be used when generating link or qr code.

Alternatives you've considered

No response

Concrete use case

No response

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

No response

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @Michael-YS on GitHub (Jun 14, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5309 ### Is your feature request related to a problem? As of right now, the link and qr code generated are based upon the domain for the panel. In cases where panel url isn't the same as inbound url (for example: access via tailscale or ssh port forwarding), the address in the link/qr code isn't aligned with the actual inbound domain. For example: Deploy an 3x-ui on a machine, and access the panel via ssh port forwarding. When import via link or qr code in the client, the destination is shown as 127.0.0.1 instead of the real domain name for the server. ### Describe the solution you'd like Add a field in the config page to specify this "inbound domain name", which will be used when generating link or qr code. ### Alternatives you've considered _No response_ ### Concrete use case _No response_ ### Mockups, screenshots, or examples _No response_ ### Which parts of the panel would this affect? _No response_ ### Are you willing to help? - [ ] I'd like to implement this feature myself and open a PR. - [x] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
bsakaguchi 2026-10-31 20:34:28 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 14, 2026):

This configuration is already supported without any code changes. There are two independent mechanisms, both confirmed in the current source.

Option 1 — Global subscription domain override (covers your exact use case)

In the panel go to Settings → Subscription and set the Listen Domain field (backend key subDomain, confirmed in internal/web/service/setting.go and frontend/src/pages/settings/SubscriptionGeneralTab.tsx).

When the panel or subscription service is reached on a loopback address (127.x, localhost, ::1) — which is exactly what SSH port forwarding produces — the backend automatically substitutes the configured subDomain (or webDomain as a fallback) in all generated subscription links. The same substitution applies on the frontend side for share links and QR codes: preferPublicHost() in frontend/src/lib/xray/inbound-link.ts replaces the loopback browser hostname with the configured domain before building any link or QR code.

Priority order (confirmed in internal/sub/service.go:configuredPublicHost() and frontend/src/pages/inbounds/useInbounds.ts):

  1. subDomain (Settings → Subscription → Listen Domain)
  2. webDomain (Settings → Panel → Listen Domain) as fallback
  3. The raw request host if neither is set

Setting subDomain to your real public domain or IP is sufficient to resolve the 127.0.0.1 issue you described.

Option 2 — Per-inbound "Share address strategy" (for mixed-address setups)

Each inbound has a Share address strategy field with three options (confirmed in frontend/src/lib/xray/inbound-link.ts:resolveAddr() and the inbound edit form):

  • node — use the node/panel address (default)
  • listen — use the inbound's listen address when it is publicly routable
  • custom — use the value entered in the Custom share address field for that inbound

The custom strategy lets you set a per-inbound public domain or IP that is written into share links, QR codes, and subscription output independently of the global domain setting.

Both options are available in the current release without any additional configuration files or environment variables.


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

<!-- gh-comment-id:4700996797 --> @github-actions[bot] commented on GitHub (Jun 14, 2026): This configuration is already supported without any code changes. There are two independent mechanisms, both confirmed in the current source. **Option 1 — Global subscription domain override (covers your exact use case)** In the panel go to **Settings → Subscription** and set the **Listen Domain** field (backend key `subDomain`, confirmed in `internal/web/service/setting.go` and `frontend/src/pages/settings/SubscriptionGeneralTab.tsx`). When the panel or subscription service is reached on a loopback address (`127.x`, `localhost`, `::1`) — which is exactly what SSH port forwarding produces — the backend automatically substitutes the configured `subDomain` (or `webDomain` as a fallback) in all generated subscription links. The same substitution applies on the frontend side for share links and QR codes: `preferPublicHost()` in `frontend/src/lib/xray/inbound-link.ts` replaces the loopback browser hostname with the configured domain before building any link or QR code. Priority order (confirmed in `internal/sub/service.go:configuredPublicHost()` and `frontend/src/pages/inbounds/useInbounds.ts`): 1. `subDomain` (Settings → Subscription → Listen Domain) 2. `webDomain` (Settings → Panel → Listen Domain) as fallback 3. The raw request host if neither is set Setting `subDomain` to your real public domain or IP is sufficient to resolve the `127.0.0.1` issue you described. **Option 2 — Per-inbound "Share address strategy" (for mixed-address setups)** Each inbound has a **Share address strategy** field with three options (confirmed in `frontend/src/lib/xray/inbound-link.ts:resolveAddr()` and the inbound edit form): - `node` — use the node/panel address (default) - `listen` — use the inbound's listen address when it is publicly routable - `custom` — use the value entered in the **Custom share address** field for that inbound The `custom` strategy lets you set a per-inbound public domain or IP that is written into share links, QR codes, and subscription output independently of the global domain setting. Both options are available in the current release without any additional configuration files or environment variables. --- *This reply was generated automatically; a maintainer may follow up.*
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#3720
No description provided.