mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4907] [Bug]: A blank page appears when subscribing in the URL reverse proxy. #3430
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#3430
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 @ckun52880 on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4907
Describe the bug
Subscriptions show a blank page in the URL reverse proxy. Nginx is listening on the domain a.example.com. When the a.example.com domain does not have a specific URL, it will be forwarded to a self-built disguised web service. However, when setting up a subscription in the 3x-ui web panel and enabling the reverse proxy URL in the subscription, opening the sub actually shows a blank page, while JSON and CLASH can run normally. I created a new domain b.example.com, and when listening entirely on port 2096, the sub works normally.
How to reproduce the problem
The following is the nginx configuration a.example.com
The following is the nginx configuration b.example.com
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
v3.2.7
Xray-core version
v26.6.1
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-112-generic x86_64)
Which parts of the panel are affected?
Subscription (share links / Clash / JSON)
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
Yes — Nginx
Before submitting
@github-actions[bot] commented on GitHub (Jun 4, 2026):
Root Cause
This is a reverse-proxy asset routing problem specific to the HTML subscription page (the React SPA served when a browser opens the sub URL with
Accept: text/html).Here is what happens step by step:
GET /sub/aa/<TOKEN>withAccept: text/htmlfrom the browser.http://127.0.0.1:2096/sub/bb/<TOKEN>.Acceptheader and returnssubpage.html— the React SPA.base_pathto its configured SubPath (e.g./sub/bb/), and rewrites all assetsrc/hreftags insubpage.htmlto/sub/bb/assets/…(seesub/sub.golines 94–101 andsub/subController.golines 188–192).https://a.example.com/sub/bb/assets/index-xxx.js./sub/bb/— it only has one for/sub/aa/. The request falls through to the catch-alllocation /block and is forwarded to port 5212 (your disguised web service) instead of port 2096. The assets return unrelated content → blank React page.JSON and CLASH subscriptions work because they return plain
text/plain/application/yamldata with no external asset references.Fix (simplest)
Align the 3x-ui SubPath with what nginx exposes publicly, so no path rewrite is needed.
Step 1 — Change the Sub Path in the panel settings:
Go to Panel Settings → Subscription → Sub Path and change it from
/sub/bb/to/sub/aa/.After saving, restart the service:
Step 2 — Update the nginx
proxy_passto remove the path rewrite:With both sides using
/sub/aa/, thebase_pathinside the HTML will be/sub/aa/, the assets will be requested from/sub/aa/assets/…, and that path is proxied correctly to port 2096.Alternative Fix (keep the path rewrite)
If you need to keep
/sub/aa/→/sub/bb/for other reasons, add an extra nginx location to also proxy the asset path to the sub server:Place this block before your catch-all
location /block.