torrents: document NPM web UI instance labels (OPEN/VPN badges)
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
# qBittorrent Web UI Instance Labels
|
||||
|
||||
The `open` and `vpn` instances are proxied via nginx-proxy-manager and have colored
|
||||
badges injected into the Web UI to distinguish them at a glance.
|
||||
|
||||
## How it works
|
||||
|
||||
nginx's `sub_filter` module replaces `</head>` in the HTML response with a `<style>`
|
||||
block that adds a fixed-position badge in the top-right corner of the page.
|
||||
|
||||
**open** (qbto.kolpacksoftware.com) — blue badge
|
||||
**vpn** (qbtv.kolpacksoftware.com) — green badge
|
||||
|
||||
## NPM Advanced tab config
|
||||
|
||||
For each proxy host, the following is set in the **Advanced** tab:
|
||||
|
||||
**open:**
|
||||
```nginx
|
||||
sub_filter '</head>' '<style>body::after{content:"OPEN";position:fixed;top:5px;right:5px;background:#1565c0;color:#fff;padding:3px 10px;border-radius:3px;font-size:13px;font-weight:bold;z-index:99999;font-family:monospace;pointer-events:none;}</style></head>';
|
||||
sub_filter_once on;
|
||||
proxy_set_header Accept-Encoding "";
|
||||
```
|
||||
|
||||
**vpn:**
|
||||
```nginx
|
||||
sub_filter '</head>' '<style>body::after{content:"VPN";position:fixed;top:5px;right:5px;background:#2e7d32;color:#fff;padding:3px 10px;border-radius:3px;font-size:13px;font-weight:bold;z-index:99999;font-family:monospace;pointer-events:none;}</style></head>';
|
||||
sub_filter_once on;
|
||||
proxy_set_header Accept-Encoding "";
|
||||
```
|
||||
|
||||
## Important: manual fix required after saving in NPM UI
|
||||
|
||||
NPM regenerates the nginx conf file whenever you save a proxy host in the UI,
|
||||
which overwrites a necessary fix. After saving either proxy host, re-run:
|
||||
|
||||
```bash
|
||||
# For open (proxy host 4):
|
||||
sudo sed -i 's| include conf.d/include/proxy.conf;| proxy_set_header Accept-Encoding "";\n include conf.d/include/proxy.conf;|' /srv/nginx-proxy/data/nginx/proxy_host/4.conf
|
||||
|
||||
# For vpn (proxy host 28):
|
||||
sudo sed -i 's| include conf.d/include/proxy.conf;| proxy_set_header Accept-Encoding "";\n include conf.d/include/proxy.conf;|' /srv/nginx-proxy/data/nginx/proxy_host/28.conf
|
||||
|
||||
docker exec nginx-proxy nginx -s reload
|
||||
```
|
||||
|
||||
### Why is this needed?
|
||||
|
||||
`proxy_set_header Accept-Encoding ""` must be inside the `location /` block for
|
||||
nginx to actually strip the header before forwarding to qBittorrent. When set at
|
||||
the server block level (via NPM's Advanced tab), it is silently ignored because
|
||||
the location block defines its own `proxy_set_header` directives via `proxy.conf`.
|
||||
|
||||
Without this fix, qBittorrent returns gzip-compressed responses and `sub_filter`
|
||||
cannot process them, so the badge never appears.
|
||||
Reference in New Issue
Block a user