mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-09-18 23:57:37 +02:00
* fix(filebrowser_quantum): repair direct access on port 8071 1.5.1.1 published the port but direct access still did not work, in two ways measured against a running instance: 1. The root redirect was absolute, so nginx built it from $server_port and sent the browser to :8072 — the container-internal port, not the published one. `absolute_redirect off` keeps the redirect relative. 2. The page served under /filebrowser_quantum/ referenced its assets under the app's own baseURL (the ingress entry path), which that vhost did not route: GET /api/hassio_ingress/<hash>/public/static/favicon.svg returned 404 while the same file under /filebrowser_quantum/ returned 200. The page loaded and every asset on it failed. Rather than translating paths, the vhost now passes requests through unchanged and redirects only the bare root to the app's baseURL, which is what its own links already point at. Asset, API and websocket URLs then work without any response rewriting. Ingress is untouched. * docs(filebrowser_quantum): describe the legacy redirects accurately The comments, CHANGELOG and README still said only the bare root was redirected, which stopped being true when the two /filebrowser_quantum compatibility redirects were added. Raised by CodeRabbit and Codex.
41 lines
1.4 KiB
Plaintext
41 lines
1.4 KiB
Plaintext
server {
|
|
listen 0.0.0.0:8072 default_server;
|
|
|
|
include /etc/nginx/includes/server_params.conf;
|
|
include /etc/nginx/includes/proxy_params.conf;
|
|
|
|
client_max_body_size 0;
|
|
|
|
# nginx listens on 8072 inside the container but is published to the host
|
|
# as 8071. An absolute redirect would be built from $server_port and send
|
|
# the browser to :8072, which is not published and therefore unreachable.
|
|
absolute_redirect off;
|
|
|
|
# FileBrowser serves under its baseURL (the Supervisor ingress entry) and
|
|
# emits that prefix as absolute links in its HTML/JS, so the browser must
|
|
# use that same path here. The bare root and the two legacy paths below
|
|
# redirect to it; every other request is proxied through untouched, which
|
|
# keeps asset, API and websocket URLs working without response rewriting.
|
|
location = / {
|
|
return 302 %%subpath%%;
|
|
}
|
|
|
|
# 1.5.1.1 briefly documented /filebrowser_quantum/ as the direct URL. The
|
|
# app never served that path itself, so send those bookmarks on instead of
|
|
# letting them fall through to a 404.
|
|
location = /filebrowser_quantum {
|
|
return 302 %%subpath%%;
|
|
}
|
|
|
|
location = /filebrowser_quantum/ {
|
|
return 302 %%subpath%%;
|
|
}
|
|
|
|
location / {
|
|
proxy_connect_timeout 30m;
|
|
proxy_send_timeout 30m;
|
|
proxy_read_timeout 30m;
|
|
proxy_pass %%protocol%%://backend;
|
|
}
|
|
}
|