[GH-ISSUE #5868] [Bug]: Blank page after login when using custom URI Path behind reverse proxy #4073

Closed
opened 2026-10-31 20:36:57 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @super-administrator on GitHub (Jul 9, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5868

Describe the bug

When accessing the 3X-UI panel through an Nginx reverse proxy with a domain name, the login page loads correctly and login succeeds, but after login the page becomes blank.

The issue only occurs when a custom URI Path is configured.

If URI Path is empty or set to /, the panel works normally through the reverse proxy domain.

If a custom URI Path is set, for example /z4s8rDfU2VdfQ5wUAI/, the login page can still be opened, but after successful login the panel UI becomes blank.

Direct IP access works normally.

How to reproduce the problem

  1. Install 3X-UI v3.4.2 on CentOS 8
  2. Log in to the panel directly via IP address. The panel works normally.
  3. Configure Nginx 1.29.4 as a reverse proxy and access the panel through a domain name.
  4. The login page loads correctly through the reverse proxy domain, but after successful login the page becomes blank.
  5. Log in again via IP address and set Listen Domain to the domain name in Panel Settings -> General.
  6. After saving and restarting the panel, the panel can no longer be accessed through either IP address or domain name.
  7. Run the x-ui command in the terminal and select 9. Reset Settings.
  8. After resetting the settings, test the reverse proxy domain again. The panel can be accessed normally after login.
  9. Set URI Path to a custom value, for example /z4s8rDfU2VdfQ5wUAI/.
  10. Save the settings and restart the panel.
  11. Access the panel through the reverse proxy domain again.
  12. The login page loads correctly, but after successful login the page becomes blank again.

Expected behavior

Expected behavior

After configuring Nginx as a reverse proxy, the 3X-UI panel should work normally when accessed through the reverse proxy domain.

Specifically:

  1. The login page should load correctly through the reverse proxy domain.
  2. After successful login, the panel dashboard should load normally instead of showing a blank page.
  3. Setting a custom URI Path, for example /z4s8rDfU2VdfQ5wUAI/, should allow the panel to continue working normally under that path.

Actual behavior

When 3X-UI v3.4.2 is placed behind Nginx reverse proxy, the login page loads correctly through the reverse proxy domain, but after successful login the page becomes blank.

The issue can be reproduced in two situations:

  1. If Listen Domain is set to the reverse proxy domain in Panel Settings -> General, after saving and restarting the panel, the panel becomes inaccessible through both the IP address and the reverse proxy domain.
  2. After resetting the panel settings with x-ui -> 9. Reset Settings, the reverse proxy domain works again. However, once a custom URI Path is configured, for example /z4s8rDfU2VdfQ5wUAI/, the login page still loads correctly, but after successful login the page becomes blank again.

The reverse proxy itself appears to be working, because the login page can be loaded normally and login can be submitted. The problem seems to occur after login, likely when the frontend redirects, loads assets, or sends API requests under the configured domain/path.

The same Nginx reverse proxy configuration works correctly with v3.3.1. In that version, the panel can be accessed normally through the reverse proxy domain, including after login.

Relevant logs

-- Logs begin at Thu 2026-07-09 13:52:17 CST, end at Thu 2026-07-09 13:53:41 CST. --
Jul 09 13:52:17 instance systemd[1]: Stopping x-ui Service...
Jul 09 13:52:18 instance x-ui[3044084]: 2026/07/09 13:52:18 Shutting down servers.
Jul 09 13:52:18 instance systemd[1]: x-ui.service: Succeeded.
Jul 09 13:52:18 instance systemd[1]: Stopped x-ui Service.
Jul 09 13:52:18 instance systemd[1]: Started x-ui Service.
Jul 09 13:52:18 instance x-ui[3084150]: 2026/07/09 13:52:18 Starting x-ui 3.4.2
Jul 09 13:52:18 instance /usr/local/x-ui/x-ui[3084150]: INFO - GC percent set to 75
Jul 09 13:52:18 instance /usr/local/x-ui/x-ui[3084150]: INFO - Go memory soft limit not enforced: no explicit budget; soft limit left at Go default
Jul 09 13:52:19 instance /usr/local/x-ui/x-ui[3084150]: INFO - Web server running HTTP on [::]:8080
Jul 09 13:52:20 instance /usr/local/x-ui/x-ui[3084150]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json}
Jul 09 13:52:30 instance /usr/local/x-ui/x-ui[3084150]: INFO - xray core supports the online-stats API; using connection-based onlines and access-log-free IP limit
Jul 09 13:53:41 instance /usr/local/x-ui/x-ui[3084150]: INFO - LJMkfTlbDu logged in successfully, Ip Address: xxx.xxx.xxx.xxx
Jul 09 13:53:41 instance /usr/local/x-ui/x-ui[3084150]: INFO - LJMkfTlbDu logged in successfully

The backend log only shows a normal service restart and successful login

Screenshots

Image Image Image

3x-ui version

3.4.2

Xray-core version

v26.6.27

How did you install 3x-ui?

install.sh script

Operating system

CentOS 8

Which parts of the panel are affected?

No response

Browser (only if it is a UI bug)

chrome 149.0.7827.158

Is the panel behind a reverse proxy or CDN?

Nginx reverse proxy + Cloudflare CDN

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @super-administrator on GitHub (Jul 9, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5868 ### Describe the bug When accessing the 3X-UI panel through an Nginx reverse proxy with a domain name, the login page loads correctly and login succeeds, but after login the page becomes blank. The issue only occurs when a custom `URI Path` is configured. If `URI Path` is empty or set to `/`, the panel works normally through the reverse proxy domain. If a custom `URI Path` is set, for example `/z4s8rDfU2VdfQ5wUAI/`, the login page can still be opened, but after successful login the panel UI becomes blank. Direct IP access works normally. ### How to reproduce the problem 1. Install 3X-UI v3.4.2 on CentOS 8 2. Log in to the panel directly via IP address. The panel works normally. 3. Configure Nginx 1.29.4 as a reverse proxy and access the panel through a domain name. 4. The login page loads correctly through the reverse proxy domain, but after successful login the page becomes blank. 5. Log in again via IP address and set `Listen Domain` to the domain name in `Panel Settings -> General`. 6. After saving and restarting the panel, the panel can no longer be accessed through either IP address or domain name. 7. Run the `x-ui` command in the terminal and select `9. Reset Settings`. 8. After resetting the settings, test the reverse proxy domain again. The panel can be accessed normally after login. 9. Set `URI Path` to a custom value, for example `/z4s8rDfU2VdfQ5wUAI/`. 10. Save the settings and restart the panel. 11. Access the panel through the reverse proxy domain again. 12. The login page loads correctly, but after successful login the page becomes blank again. ### Expected behavior Expected behavior After configuring Nginx as a reverse proxy, the 3X-UI panel should work normally when accessed through the reverse proxy domain. Specifically: 1. The login page should load correctly through the reverse proxy domain. 2. After successful login, the panel dashboard should load normally instead of showing a blank page. 3. Setting a custom URI Path, for example /z4s8rDfU2VdfQ5wUAI/, should allow the panel to continue working normally under that path. ### Actual behavior When 3X-UI v3.4.2 is placed behind Nginx reverse proxy, the login page loads correctly through the reverse proxy domain, but after successful login the page becomes blank. The issue can be reproduced in two situations: 1. If Listen Domain is set to the reverse proxy domain in Panel Settings -> General, after saving and restarting the panel, the panel becomes inaccessible through both the IP address and the reverse proxy domain. 2. After resetting the panel settings with x-ui -> 9. Reset Settings, the reverse proxy domain works again. However, once a custom URI Path is configured, for example /z4s8rDfU2VdfQ5wUAI/, the login page still loads correctly, but after successful login the page becomes blank again. The reverse proxy itself appears to be working, because the login page can be loaded normally and login can be submitted. The problem seems to occur after login, likely when the frontend redirects, loads assets, or sends API requests under the configured domain/path. The same Nginx reverse proxy configuration works correctly with v3.3.1. In that version, the panel can be accessed normally through the reverse proxy domain, including after login. ### Relevant logs ```shell -- Logs begin at Thu 2026-07-09 13:52:17 CST, end at Thu 2026-07-09 13:53:41 CST. -- Jul 09 13:52:17 instance systemd[1]: Stopping x-ui Service... Jul 09 13:52:18 instance x-ui[3044084]: 2026/07/09 13:52:18 Shutting down servers. Jul 09 13:52:18 instance systemd[1]: x-ui.service: Succeeded. Jul 09 13:52:18 instance systemd[1]: Stopped x-ui Service. Jul 09 13:52:18 instance systemd[1]: Started x-ui Service. Jul 09 13:52:18 instance x-ui[3084150]: 2026/07/09 13:52:18 Starting x-ui 3.4.2 Jul 09 13:52:18 instance /usr/local/x-ui/x-ui[3084150]: INFO - GC percent set to 75 Jul 09 13:52:18 instance /usr/local/x-ui/x-ui[3084150]: INFO - Go memory soft limit not enforced: no explicit budget; soft limit left at Go default Jul 09 13:52:19 instance /usr/local/x-ui/x-ui[3084150]: INFO - Web server running HTTP on [::]:8080 Jul 09 13:52:20 instance /usr/local/x-ui/x-ui[3084150]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json} Jul 09 13:52:30 instance /usr/local/x-ui/x-ui[3084150]: INFO - xray core supports the online-stats API; using connection-based onlines and access-log-free IP limit Jul 09 13:53:41 instance /usr/local/x-ui/x-ui[3084150]: INFO - LJMkfTlbDu logged in successfully, Ip Address: xxx.xxx.xxx.xxx Jul 09 13:53:41 instance /usr/local/x-ui/x-ui[3084150]: INFO - LJMkfTlbDu logged in successfully ``` The backend log only shows a normal service restart and successful login ### Screenshots <img width="1073" height="620" alt="Image" src="https://github.com/user-attachments/assets/a8f2abd7-572f-4e15-8566-155523c30e29" /> <img width="1050" height="657" alt="Image" src="https://github.com/user-attachments/assets/f12fac1f-47db-473d-86b1-44d3a09d91a3" /> <img width="1006" height="605" alt="Image" src="https://github.com/user-attachments/assets/6e5b8a5c-4605-4839-851c-8f798348df7a" /> ### 3x-ui version 3.4.2 ### Xray-core version v26.6.27 ### How did you install 3x-ui? install.sh script ### Operating system CentOS 8 ### Which parts of the panel are affected? _No response_ ### Browser (only if it is a UI bug) chrome 149.0.7827.158 ### Is the panel behind a reverse proxy or CDN? Nginx reverse proxy + Cloudflare CDN ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:36:57 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jul 9, 2026):

I reviewed the base-path, session, and reverse-proxy-related code (internal/web/web.go, internal/web/controller/dist.go, internal/web/middleware/domainValidator.go, frontend/vite.config.js, frontend/src/pages/settings/SettingsPage.tsx) but could not confirm a single line that produces a blank page after every login through the proxy with a custom URI Path. The mechanism that's supposed to make a custom base path work looks host-agnostic: serveDistPage (internal/web/controller/dist.go:74-131) rewrites the entry HTML's asset src/href to the configured base path, and the Vite renderBuiltUrl hook (frontend/vite.config.js:149-158) resolves lazy-loaded page chunks against window.X_UI_BASE_PATH at runtime rather than baking in a fixed prefix at build time. Neither depends on Host. Pinning down the actual cause needs your browser's console/network output (see the ask below).

While tracing this, two other issues surfaced that match parts of your own reproduction steps and are worth flagging regardless of the main cause:

  1. "Listen Domain" lockout (steps 5-6). DomainValidatorMiddleware (internal/web/middleware/domainValidator.go:17-31) 403s any request unless Host (minus port) is an exact, case-sensitive match for the stored webDomain. Nothing normalizes that value: the backend getter (internal/web/service/setting.go:413-415) returns it raw, and the frontend schema (webDomain: z.string().optional(), frontend/src/schemas/setting.ts:9) has no format check — unlike webBasePath, which is constrained to absolutePath. A stray https:// prefix, trailing / or space, or wrong case in "Listen Domain" makes every request fail that comparison, from the domain and from any IP alike, which matches "the panel can no longer be accessed through either IP address or domain name" until Reset Settings cleared it.

  2. "Restart Panel" can drop you to http:// (step 10). The Settings page's "Restart Panel" button calls rebuildUrlAfterRestart() (frontend/src/pages/settings/SettingsPage.tsx:100-123). For a non-IP hostname (your case), it sets newProtocol = (webCertFile || webKeyFile) ? 'https:' : 'http:' and forces url.protocol = newProtocol before navigating. A reverse-proxy setup normally leaves the panel's own webCertFile/webKeyFile empty since Nginx terminates TLS, so this evaluates to http: and can send the browser to a plain-HTTP URL Nginx isn't serving on that domain — which would look exactly like "loads, then goes blank/unreachable" right after a save-and-restart done from the panel UI.

To isolate the core "blank after login" report, could you provide:

  1. The Nginx server/location block for the panel (redact the real domain) — the documented pattern is a location <path>/ { proxy_pass http://127.0.0.1:<port>; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; ... } with no path segment after the port, so Nginx forwards the URI unchanged; a rewritten/stripped prefix is the most common cause of this exact symptom pattern.
  2. Browser DevTools Console + Network tab output captured at the moment the page goes blank — specifically any 404/403/mixed-content errors and the status of the WebSocket handshake to wss://<domain>/<uriPath>ws.
  3. The panel log from around that time (journalctl -u x-ui -n 200, or the configured XUI_LOG_FOLDER).
  4. Whether "restart the panel" in steps 6 and 10 was the Settings page's "Restart Panel" button or the x-ui CLI menu / systemctl restart x-ui — this determines whether finding 2 above is in play.

@MHSanaei flagging findings 1 and 2 above for a decision either way — both look like real gaps in internal/web/middleware/domainValidator.go and frontend/src/pages/settings/SettingsPage.tsx, independent of whatever turns out to cause the main report.

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

<!-- gh-comment-id:4921958393 --> @github-actions[bot] commented on GitHub (Jul 9, 2026): I reviewed the base-path, session, and reverse-proxy-related code (`internal/web/web.go`, `internal/web/controller/dist.go`, `internal/web/middleware/domainValidator.go`, `frontend/vite.config.js`, `frontend/src/pages/settings/SettingsPage.tsx`) but could not confirm a single line that produces a blank page after every login through the proxy with a custom `URI Path`. The mechanism that's supposed to make a custom base path work looks host-agnostic: `serveDistPage` (`internal/web/controller/dist.go:74-131`) rewrites the entry HTML's asset `src`/`href` to the configured base path, and the Vite `renderBuiltUrl` hook (`frontend/vite.config.js:149-158`) resolves lazy-loaded page chunks against `window.X_UI_BASE_PATH` at runtime rather than baking in a fixed prefix at build time. Neither depends on `Host`. Pinning down the actual cause needs your browser's console/network output (see the ask below). While tracing this, two other issues surfaced that match parts of your own reproduction steps and are worth flagging regardless of the main cause: 1. **"Listen Domain" lockout (steps 5-6).** `DomainValidatorMiddleware` (`internal/web/middleware/domainValidator.go:17-31`) 403s any request unless `Host` (minus port) is an *exact, case-sensitive* match for the stored `webDomain`. Nothing normalizes that value: the backend getter (`internal/web/service/setting.go:413-415`) returns it raw, and the frontend schema (`webDomain: z.string().optional()`, `frontend/src/schemas/setting.ts:9`) has no format check — unlike `webBasePath`, which is constrained to `absolutePath`. A stray `https://` prefix, trailing `/` or space, or wrong case in "Listen Domain" makes *every* request fail that comparison, from the domain and from any IP alike, which matches "the panel can no longer be accessed through either IP address or domain name" until Reset Settings cleared it. 2. **"Restart Panel" can drop you to `http://` (step 10).** The Settings page's "Restart Panel" button calls `rebuildUrlAfterRestart()` (`frontend/src/pages/settings/SettingsPage.tsx:100-123`). For a non-IP hostname (your case), it sets `newProtocol = (webCertFile || webKeyFile) ? 'https:' : 'http:'` and forces `url.protocol = newProtocol` before navigating. A reverse-proxy setup normally leaves the panel's own `webCertFile`/`webKeyFile` empty since Nginx terminates TLS, so this evaluates to `http:` and can send the browser to a plain-HTTP URL Nginx isn't serving on that domain — which would look exactly like "loads, then goes blank/unreachable" right after a save-and-restart done from the panel UI. To isolate the core "blank after login" report, could you provide: 1. The Nginx `server`/`location` block for the panel (redact the real domain) — the documented pattern is a `location <path>/ { proxy_pass http://127.0.0.1:<port>; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; ... }` with **no** path segment after the port, so Nginx forwards the URI unchanged; a rewritten/stripped prefix is the most common cause of this exact symptom pattern. 2. Browser DevTools Console + Network tab output captured at the moment the page goes blank — specifically any 404/403/mixed-content errors and the status of the WebSocket handshake to `wss://<domain>/<uriPath>ws`. 3. The panel log from around that time (`journalctl -u x-ui -n 200`, or the configured `XUI_LOG_FOLDER`). 4. Whether "restart the panel" in steps 6 and 10 was the Settings page's "Restart Panel" button or the `x-ui` CLI menu / `systemctl restart x-ui` — this determines whether finding 2 above is in play. @MHSanaei flagging findings 1 and 2 above for a decision either way — both look like real gaps in `internal/web/middleware/domainValidator.go` and `frontend/src/pages/settings/SettingsPage.tsx`, independent of whatever turns out to cause the main report. *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@super-administrator commented on GitHub (Jul 9, 2026):

Thanks for the analysis. I retested the issue and narrowed it down further.

The problem does not seem to be caused by URI Path alone. With a custom URI Path such as /z4s8rDfU2VdfQ5wUAI/, direct IP access works normally. For example, https://<server-ip>:port/z4s8rDfU2VdfQ5wUAI/panel/settings loads correctly, and the URI Path value is shown correctly in the panel settings.

However, with the same custom URI Path, access through the Nginx reverse proxy domain becomes blank after login. The login page loads correctly at https://<domain>/z4s8rDfU2VdfQ5wUAI/, and after login it redirects to https://<domain>/z4s8rDfU2VdfQ5wUAI/panel/, but the page is blank.

So the current comparison is: URI Path = / with the reverse proxy domain works normally; custom URI Path with direct IP access also works normally; but custom URI Path with the reverse proxy domain shows a blank page after login. The same Nginx reverse proxy configuration also works correctly with v3.3.1.

Therefore, this issue seems limited to v3.4.2 + Nginx reverse proxy domain + custom URI Path.

From the browser Network tab, the main document and most JS/CSS assets return 200. The panel log also shows successful login, with no obvious backend error in journalctl -u x-ui -n 200. This suggests the login itself succeeds, and the issue may occur during frontend routing or rendering after login.

One correction to my original report: I selected None for “Is the panel behind a reverse proxy or CDN?”, but the correct setup is Nginx reverse proxy + Cloudflare CDN. TLS is handled by Nginx / Cloudflare, while the 3X-UI panel itself runs HTTP on the server.

I will try to provide browser Console errors next, since Network mostly returns 200 while the page still becomes blank.

Image Image Image Image
<!-- gh-comment-id:4922111435 --> @super-administrator commented on GitHub (Jul 9, 2026): Thanks for the analysis. I retested the issue and narrowed it down further. The problem does not seem to be caused by `URI Path` alone. With a custom URI Path such as `/z4s8rDfU2VdfQ5wUAI/`, direct IP access works normally. For example, `https://<server-ip>:port/z4s8rDfU2VdfQ5wUAI/panel/settings` loads correctly, and the URI Path value is shown correctly in the panel settings. However, with the same custom URI Path, access through the Nginx reverse proxy domain becomes blank after login. The login page loads correctly at `https://<domain>/z4s8rDfU2VdfQ5wUAI/`, and after login it redirects to `https://<domain>/z4s8rDfU2VdfQ5wUAI/panel/`, but the page is blank. So the current comparison is: `URI Path = /` with the reverse proxy domain works normally; custom URI Path with direct IP access also works normally; but custom URI Path with the reverse proxy domain shows a blank page after login. The same Nginx reverse proxy configuration also works correctly with `v3.3.1`. Therefore, this issue seems limited to `v3.4.2 + Nginx reverse proxy domain + custom URI Path`. From the browser Network tab, the main document and most JS/CSS assets return `200`. The panel log also shows successful login, with no obvious backend error in `journalctl -u x-ui -n 200`. This suggests the login itself succeeds, and the issue may occur during frontend routing or rendering after login. One correction to my original report: I selected `None` for “Is the panel behind a reverse proxy or CDN?”, but the correct setup is `Nginx reverse proxy + Cloudflare CDN`. TLS is handled by Nginx / Cloudflare, while the 3X-UI panel itself runs HTTP on the server. I will try to provide browser Console errors next, since Network mostly returns `200` while the page still becomes blank. <img width="1024" height="786" alt="Image" src="https://github.com/user-attachments/assets/77c01ad9-cdc4-4b38-a797-147b54c3eeee" /> <img width="1028" height="758" alt="Image" src="https://github.com/user-attachments/assets/3c979ad9-c2fe-4250-ac1c-309932ecdcee" /> <img width="1447" height="299" alt="Image" src="https://github.com/user-attachments/assets/978fb3ff-8aa0-4597-beab-7ebbce48cbf6" /> <img width="1760" height="591" alt="Image" src="https://github.com/user-attachments/assets/a23ab56d-a53b-4b27-8efc-9641c2256d6b" />
Author
Owner

@super-administrator commented on GitHub (Jul 9, 2026):

Sorry, I accidentally closed this issue by mistake. I have reopened it.

Please ignore the accidental close action. The issue is still reproducible, and I have added more test results.

<!-- gh-comment-id:4922126293 --> @super-administrator commented on GitHub (Jul 9, 2026): Sorry, I accidentally closed this issue by mistake. I have reopened it. Please ignore the accidental close action. The issue is still reproducible, and I have added more test results.
Author
Owner

@super-administrator commented on GitHub (Jul 13, 2026):

Thank you for the quick fix and detailed explanation. I have tested it on v3.5.0, and the issue is resolved. The panel now works normally behind Cloudflare/Nginx reverse proxy with a custom URI path. Thanks again for your work.

<!-- gh-comment-id:4955401030 --> @super-administrator commented on GitHub (Jul 13, 2026): Thank you for the quick fix and detailed explanation. I have tested it on v3.5.0, and the issue is resolved. The panel now works normally behind Cloudflare/Nginx reverse proxy with a custom URI path. Thanks again for your work.
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#4073
No description provided.