From f984535c2ac066bd799d9bf95a426c1b5e5f173d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Wed, 23 Sep 2026 13:55:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(deploy):=20absolute=5Fredirect=20off=20?= =?UTF-8?q?=E2=80=94=20root=20redirect=20keeps=20host:port=20through=20rev?= =?UTF-8?q?erse=20proxy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nginx 默认 absolute_redirect on:return 302 被绝对化为 scheme://Host/(经 OpenResty 反代 Host 无端口 → 32005/ 跳到无端口的 /admin/ 打不开)。 off 后发相对 Location,浏览器按当前 host:port 补全。 Co-Authored-By: Claude Code --- infra/deploy/nginx.conf.template | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/infra/deploy/nginx.conf.template b/infra/deploy/nginx.conf.template index 400111d..6afec06 100644 --- a/infra/deploy/nginx.conf.template +++ b/infra/deploy/nginx.conf.template @@ -26,6 +26,11 @@ server { root /usr/share/nginx/html/viewer; index index.html; + # 跳转一律发相对 Location(absolute_redirect 默认 on 会按收到的 Host 头 + # 绝对化——经反代丢端口,浏览器跳到无端口的 80;off 后浏览器按当前 + # host:port 补全,2026-09-23 用户报告 32005/ 丢端口即此因)。 + absolute_redirect off; + gzip on; gzip_comp_level 5; gzip_min_length 1024;