[GH-ISSUE #5940] [Bug]: Empty Subscription page in browser when using Reverse Proxy (huge JS files for proxing) #4119

Closed
opened 2026-10-31 20:37:18 +07:00 by bsakaguchi · 2 comments
Owner

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

  1. Set the reverse proxy as it explained in Wiki
  2. Open subscription page in desktop or mobile browser
  3. Empty page will appears

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

Jul 13 14:51:40 VM-236127 nginx[58846]: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/5/13/0000000135" failed (13: Permission denied) while reading upstream, client: .... , server: ..... , request: "GET /HFVXKkx2TFxvd3DXea/assets/vendor-antd-BbTQ2OKR.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/vendor-antd-BbTQ2OKR.js", host: "....", referrer: "https://...../HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a"
Jul 13 14:51:40 VM-236127 nginx[58846]: vm-236127 nginx_error: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/6/13/0000000136" failed (13: Permission denied) while reading upstream, client: ...., server: ......, request: "GET /HFVXKkx2TFxvd3DXea/assets/vendor-icons-BlVhUFCu.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/vendor-icons-BlVhUFCu.js", host: "....", referrer: "https://....../HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a"
Jul 13 14:51:40 VM-236127 nginx[58846]: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/6/13/0000000136" failed (13: Permission denied) while reading upstream, client: ....., server: ......, request: "GET /HFVXKkx2TFxvd3DXea/assets/vendor-icons-BlVhUFCu.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/vendor-icons-BlVhUFCu.js", host: ".......", referrer: "https://......../HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a"
Jul 13 14:51:40 VM-236127 nginx[58846]: vm-236127 nginx_error: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/7/13/0000000137" failed (13: Permission denied) while reading upstream, client: ......, server: ....., request: "GET /HFVXKkx2TFxvd3DXea/assets/QueryProvider-BpqF0wak.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/QueryProvider-BpqF0wak.js", host: "........", referrer: "https://........./HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a"
Jul 13 14:51:40 VM-236127 nginx[58846]: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/7/13/0000000137" failed (13: Permission denied) while reading upstream, client: ........, server: ......, request: "GET /HFVXKkx2TFxvd3DXea/assets/QueryProvider-BpqF0wak.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/QueryProvider-BpqF0wak.js", host: "........", referrer: "https://........./HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a"
Jul 13 14:51:40 VM-236127 nginx[58846]: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/8/13/0000000138" failed (13: Permission denied) while reading upstream, client: ......., server: ......, request: "GET /HFVXKkx2TFxvd3DXea/assets/vendor-9RGqlMPm.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/vendor-9RGqlMPm.js", host: ".......", referrer: "https://......./HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a"
Jul 13 14:51:40 VM-236127 nginx[58846]: vm-236127 nginx_error: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/8/13/0000000138" failed (13: Permission denied) while reading upstream, client: ......., server: ......., request: "GET /HFVXKkx2TFxvd3DXea/assets/vendor-9RGqlMPm.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/vendor-9RGqlMPm.js", host: ".......", referrer: "https://......./HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a"

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

  • 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 @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 1. Set the reverse proxy as it explained in [Wiki](https://github.com/MHSanaei/3x-ui/wiki/Configuration#nginx) 2. Open subscription page in desktop or mobile browser 3. Empty page will appears 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 ```shell Jul 13 14:51:40 VM-236127 nginx[58846]: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/5/13/0000000135" failed (13: Permission denied) while reading upstream, client: .... , server: ..... , request: "GET /HFVXKkx2TFxvd3DXea/assets/vendor-antd-BbTQ2OKR.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/vendor-antd-BbTQ2OKR.js", host: "....", referrer: "https://...../HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a" Jul 13 14:51:40 VM-236127 nginx[58846]: vm-236127 nginx_error: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/6/13/0000000136" failed (13: Permission denied) while reading upstream, client: ...., server: ......, request: "GET /HFVXKkx2TFxvd3DXea/assets/vendor-icons-BlVhUFCu.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/vendor-icons-BlVhUFCu.js", host: "....", referrer: "https://....../HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a" Jul 13 14:51:40 VM-236127 nginx[58846]: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/6/13/0000000136" failed (13: Permission denied) while reading upstream, client: ....., server: ......, request: "GET /HFVXKkx2TFxvd3DXea/assets/vendor-icons-BlVhUFCu.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/vendor-icons-BlVhUFCu.js", host: ".......", referrer: "https://......../HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a" Jul 13 14:51:40 VM-236127 nginx[58846]: vm-236127 nginx_error: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/7/13/0000000137" failed (13: Permission denied) while reading upstream, client: ......, server: ....., request: "GET /HFVXKkx2TFxvd3DXea/assets/QueryProvider-BpqF0wak.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/QueryProvider-BpqF0wak.js", host: "........", referrer: "https://........./HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a" Jul 13 14:51:40 VM-236127 nginx[58846]: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/7/13/0000000137" failed (13: Permission denied) while reading upstream, client: ........, server: ......, request: "GET /HFVXKkx2TFxvd3DXea/assets/QueryProvider-BpqF0wak.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/QueryProvider-BpqF0wak.js", host: "........", referrer: "https://........./HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a" Jul 13 14:51:40 VM-236127 nginx[58846]: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/8/13/0000000138" failed (13: Permission denied) while reading upstream, client: ......., server: ......, request: "GET /HFVXKkx2TFxvd3DXea/assets/vendor-9RGqlMPm.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/vendor-9RGqlMPm.js", host: ".......", referrer: "https://......./HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a" Jul 13 14:51:40 VM-236127 nginx[58846]: vm-236127 nginx_error: 2026/07/13 14:51:40 [crit] 58846#58846: *918674 open() "/var/lib/nginx/proxy/8/13/0000000138" failed (13: Permission denied) while reading upstream, client: ......., server: ......., request: "GET /HFVXKkx2TFxvd3DXea/assets/vendor-9RGqlMPm.js HTTP/2.0", upstream: "https://127.0.0.1:2096/HFVXKkx2TFxvd3DXea/assets/vendor-9RGqlMPm.js", host: ".......", referrer: "https://......./HFVXKkx2TFxvd3DXea/oitj3fjkyloqey7a" ``` ### 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 - [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:37:18 +07:00
Author
Owner

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

The Permission denied errors in your log come from Nginx, not from 3x-ui. Nginx buffers upstream responses larger than its in-memory proxy_buffers to 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 — see maybeServeSubPage in internal/sub/controller.go:156-157 (Accept-header check) and serveSubPage at line 232. That SPA's vendor bundles are legitimately large: frontend/vite.config.js:176 sets chunkSizeWarningLimit: 1500 (1.5 MB) and lines 184-187 split out dedicated vendor-antd/vendor-icons chunks — 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 panel
Severity: Low
Category: Documentation (with a related Performance gap in code, see Recommendation)
Why this matters: internal/web/web.go:195 registers engine.Use(gzip.Gzip(gzip.DefaultCompression)) on the panel's Gin engine, but internal/sub/sub.go (initRouter, which mounts the same dist/assets under /assets at 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 raise proxy_buffers/proxy_buffer_size) to the reverse-proxy docs/generator for the /sub location, as you suggested, and to the Wiki article. (2) Consider adding the same gzip middleware used at internal/web/web.go:195 to the subscription server's engine in internal/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):

location /sub {
    proxy_pass http://127.0.0.1:2096;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_max_temp_file_size 0;
}

Labeled documentation alongside bug to reflect the two follow-ups above.

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

<!-- gh-comment-id:4958014127 --> @github-actions[bot] commented on GitHub (Jul 13, 2026): The `Permission denied` errors in your log come from Nginx, not from 3x-ui. Nginx buffers upstream responses larger than its in-memory `proxy_buffers` to 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 — see `maybeServeSubPage` in `internal/sub/controller.go:156-157` (Accept-header check) and `serveSubPage` at line 232. That SPA's vendor bundles are legitimately large: `frontend/vite.config.js:176` sets `chunkSizeWarningLimit: 1500` (1.5 MB) and lines 184-187 split out dedicated `vendor-antd`/`vendor-icons` chunks — 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 panel Severity: Low Category: Documentation (with a related Performance gap in code, see Recommendation) Why this matters: `internal/web/web.go:195` registers `engine.Use(gzip.Gzip(gzip.DefaultCompression))` on the panel's Gin engine, but `internal/sub/sub.go` (`initRouter`, which mounts the same `dist/assets` under `/assets` at 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 raise `proxy_buffers`/`proxy_buffer_size`) to the reverse-proxy docs/generator for the `/sub` location, as you suggested, and to the Wiki article. (2) Consider adding the same gzip middleware used at `internal/web/web.go:195` to the subscription server's engine in `internal/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): ```nginx location /sub { proxy_pass http://127.0.0.1:2096; proxy_http_version 1.1; proxy_set_header Host $host; proxy_max_temp_file_size 0; } ``` Labeled `documentation` alongside `bug` to reflect the two follow-ups above. *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@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.

<!-- gh-comment-id:5059127109 --> @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.
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#4119
No description provided.