From b82ae5c042d47d0e1cb9c69338d13bb681ddf38d Mon Sep 17 00:00:00 2001 From: Bart Date: Fri, 24 Jul 2026 14:53:23 +0200 Subject: [PATCH] Emit relative redirects (absolute_redirect off) so mapped ports survive nginx builds directory redirects (for example /webtools to /webtools/) as absolute URLs from its internal listen port. When the transcoder container is published on a different host port (docker -p 8081:80, or behind a reverse proxy / VPN bind), that port is dropped: GET http://host:8081/webtools 301s to http://host/webtools/ on port 80, landing on the wrong service. absolute_redirect off makes nginx emit a relative Location (/webtools/), which the browser resolves against the request URL, keeping the port. Set at the HTTP server level so it also covers /dash and any other directory. Applied to both nginx.conf and nginx-no-ssl.conf; no change for same-port (80/443) deployments. --- nginx-transcoder/nginx-no-ssl.conf | 7 +++++++ nginx-transcoder/nginx.conf | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/nginx-transcoder/nginx-no-ssl.conf b/nginx-transcoder/nginx-no-ssl.conf index 4941ca0..04cf802 100644 --- a/nginx-transcoder/nginx-no-ssl.conf +++ b/nginx-transcoder/nginx-no-ssl.conf @@ -39,6 +39,13 @@ http { limit_req_status 401; server { + # Emit RELATIVE redirects. Otherwise nginx rebuilds a directory redirect + # (e.g. /webtools -> /webtools/) from its internal listen port, dropping + # any external mapped port when the container is published on a different + # port (docker -p 8081:80, or behind a reverse proxy / VPN bind) and + # sending the browser to the wrong URL. + absolute_redirect off; + listen ${HTTP_PORT}; location / { diff --git a/nginx-transcoder/nginx.conf b/nginx-transcoder/nginx.conf index be7d508..95116a4 100644 --- a/nginx-transcoder/nginx.conf +++ b/nginx-transcoder/nginx.conf @@ -44,6 +44,13 @@ http { limit_req_status 401; server { + # Emit RELATIVE redirects. Otherwise nginx rebuilds a directory redirect + # (e.g. /webtools -> /webtools/) from its internal listen port, dropping + # any external mapped port when the container is published on a different + # port (docker -p 8081:80, or behind a reverse proxy / VPN bind) and + # sending the browser to the wrong URL. + absolute_redirect off; + listen ${HTTP_PORT}; listen 443 ssl;