mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5283] [Bug]: A white screen appears when using the Nginx proxy panel #3697
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#3697
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 @yuze66 on GitHub (Jun 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5283
Describe the bug
when I use nginx to visit my web, after login, I can not visit and white screen appears. I found these error, I am not sure that is a bug, may be it is my wrong setting
rocket-loader.min.js:1 Executing inline script violates the following Content Security Policy directive 'script-src 'self' 'nonce-9Ia+qwVxxxxxxh+ScZ6Q''. Either the 'unsafe-inline' keyword, a hash ('sha256-xxxxxxFwm/wlVb1Hf4xxxxxxxxxxiodkochw='), or a nonce ('nonce-...') is required to enable inline execution. The action has been blocked.
t.activateScript @ rocket-loader.min.js:1
vendor-router-Ba0IbRBU.js:1 is not able to match the URL "/fly/panel/" because it does not start with the basename, so the won't render anything.
_ @ vendor-router-Ba0IbRBU.js:1
userscript.html?name=%xxxxxxxxxxxxxxxxxB9.user.js&id=xxxxxx{"timestamp":xxxxxxxxxxx,"code":0,"message":"请求成功","result":[{"url":"https://cdn.lyck6.cn/adimg/1.png","hash":"dac9bexxxxxxxxxxx7613ec1fa50"},{"click":"https://www.itihey.com","url":"https://cdn.lyck6.cn/adimg/3.png","hash":"2bcca95axxxxxxxxxxx5ef497172d"}]}
How to reproduce the problem
set my web base path /fly/
visit https://xxxxxx.com/fly
after login, white screen appears
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.3.1
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
ubuntu 24.04
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
Microsoft edge
Is the panel behind a reverse proxy or CDN?
Yes — Nginx
Before submitting
@github-actions[bot] commented on GitHub (Jun 13, 2026):
The white screen is caused by Cloudflare Rocket Loader, not by your Nginx configuration. The browser console error
rocket-loader.min.js:1 Executing inline script violates the following Content Security Policy directiveis the direct indicator.What happens:
The panel backend (
internal/web/middleware/security.go) generates a per-request CSP nonce and sends it in theContent-Security-Policyresponse header:It then injects a small inline bootstrap script into the served HTML (
internal/web/controller/dist.go, line 113):Cloudflare Rocket Loader intercepts all
<script>tags to defer their execution, but it strips thenonceattribute in the process. When it tries to re-execute the script, the browser's CSP rejects it — the nonce no longer matches — so the script never runs.Because
window.X_UI_BASE_PATHis never set, the React Router falls back to its default and initializes withbasename="/panel"(frontend/src/routes.tsx, line 37-39). The browser URL is/fly/panel/, which does not start with/panel, so the Router renders nothing — producing the blank screen you see.Fix — disable Cloudflare Rocket Loader:
In the Cloudflare dashboard for your domain, go to Speed → Optimization → Content Optimization → Rocket Loader and turn it off. If you prefer a targeted rule, create a Page Rule matching
yourdomain.com/fly/*with the action "Rocket Loader: Off".After disabling it, the inline script will execute correctly,
window.X_UI_BASE_PATHwill be set to/fly/, and the Router will computebasename="/fly/panel"which matches the URL.Nginx sub-path proxy (verify your config is correct):
If you also want to confirm the Nginx side is correct, the
locationblock for a sub-path reverse proxy must pass the prefix to the upstream. A working pattern:The trailing slash on both
location /fly/andproxy_pass .../fly/is required so Nginx does not strip the prefix before forwarding.The third block in your error log (the
userscript.htmlJSON output with ad image URLs) is from a browser extension and is unrelated to this issue.This reply was generated automatically; a maintainer may follow up.
@yuze66 commented on GitHub (Jun 13, 2026):
the bug has disapper when I turn off Rocket Loader, thanks. but do you have better way handle it