mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5940] [Bug]: Empty Subscription page in browser when using Reverse Proxy (huge JS files for proxing) #4119
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#4119
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 @nebulosa2007 on GitHub (Jul 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5940
Describe the bug
When I open the default subscription page in a browser, a blank page appears. However, the HTML code is visible in the browser's Inspector.
Important: A reverse proxy (Nginx) is used to display the subscription page.
How to reproduce the problem
Fix is - need to add nginx directive to
location /sub:proxy_max_temp_file_size 0;I think the article on the wiki need to be updated.
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.5.0
Xray-core version
26.7.11
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Which parts of the panel are affected?
Frontend (UI / panel pages), Backend (API endpoints, login, settings)
Browser (only if it is a UI bug)
Firefox 152.0.5
Is the panel behind a reverse proxy or CDN?
Yes — Nginx
Before submitting
@github-actions[bot] commented on GitHub (Jul 13, 2026):
The
Permission deniederrors in your log come from Nginx, not from 3x-ui. Nginx buffers upstream responses larger than its in-memoryproxy_buffersto on-disk temp files (proxy_temp_path, e.g./var/lib/nginx/proxy/on Debian/Ubuntu packages) before relaying them. Your log lines (open() "/var/lib/nginx/proxy/5/13/0000000135" failed (13: Permission denied)) show the Nginx worker process cannot write to that directory — an ownership/permission problem with your Nginx installation itself, independent of 3x-ui.proxy_max_temp_file_size 0;is a correct fix: it tells Nginx never to spill that location's response to disk, so the unwritable temp path is never touched.This shows up specifically for the subscription page, not the panel or JSON/Clash subscriptions: your log's upstream target (
https://127.0.0.1:2096/...) is the subscription server, and opening a sub link in a browser (Accept: text/html) serves a full React SPA instead of plain text — seemaybeServeSubPageininternal/sub/controller.go:156-157(Accept-header check) andserveSubPageat line 232. That SPA's vendor bundles are legitimately large:frontend/vite.config.js:176setschunkSizeWarningLimit: 1500(1.5 MB) and lines 184-187 split out dedicatedvendor-antd/vendor-iconschunks — the same file names in your log. JSON/Clash subscriptions return small plain-text/YAML bodies and never take this code path.Title: Subscription server's SPA response (
subpage.html+/assets) is never gzip-compressed, unlike the panelSeverity: Low
Category: Documentation (with a related Performance gap in code, see Recommendation)
Why this matters:
internal/web/web.go:195registersengine.Use(gzip.Gzip(gzip.DefaultCompression))on the panel's Gin engine, butinternal/sub/sub.go(initRouter, which mounts the samedist/assetsunder/assetsat lines 212-216) never adds the equivalent for the subscription server. The same multi-hundred-KB–1.5 MB+ chunks the panel serves compressed are served uncompressed by the sub server, inflating exactly the responses that push a reverse proxy into disk-based buffering — the mechanism behind this report. Separately, the in-repo reverse-proxy guide (docs/content/docs/en/operations/reverse-proxy.mdx) and its interactive Nginx generator (docs/lib/xray/reverse-proxy.ts,buildNginx()) set no proxy-buffering directive at all, so nothing currently steers new users away from this failure mode. The GitHub Wiki page you linked lives in a separate repository from this checkout, so I could not verify or edit its current text, but it is reasonable to assume it has the same gap.Recommendation: (1) Add
proxy_max_temp_file_size 0;(or raiseproxy_buffers/proxy_buffer_size) to the reverse-proxy docs/generator for the/sublocation, as you suggested, and to the Wiki article. (2) Consider adding the same gzip middleware used atinternal/web/web.go:195to the subscription server's engine ininternal/sub/sub.go:initRouter()— this would not remove the need for correct proxy-temp-dir permissions on the reverse proxy host, but it reduces how often oversized responses trigger disk buffering in the first place. Both are maintainer calls; flagging for @MHSanaei to decide.Example (generalizing the directive you already found to the guide's location block):
Labeled
documentationalongsidebugto reflect the two follow-ups above.This reply was generated automatically; a maintainer may follow up.
@MHSanaei commented on GitHub (Jul 23, 2026):
The nginx 'Permission denied ... while reading upstream' is a proxy temp-file permission issue (your own fix was an nginx directive), not panel code. Closing.