From 8a42db50895fe3d29c725e59fa0e9f845f41562c Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Wed, 23 Sep 2026 16:34:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(nginx):=20=E4=BF=AE=E5=A4=8D=E5=AE=BF?= =?UTF-8?q?=E4=B8=BB=E6=9C=BA=E7=AB=AF=E5=8F=A3=E6=98=A0=E5=B0=84=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E8=B7=B3=E8=BD=AC=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 absolute_redirect off 配置,并修正后台链接末尾斜杠,解决宿主机 8011 映射容器 80 时跳转丢失端口的问题 --- backend/public/install/templates/step5.php | 2 +- docker/nginx/vhost.conf | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/public/install/templates/step5.php b/backend/public/install/templates/step5.php index 484e47f06..4aa13a4e5 100755 --- a/backend/public/install/templates/step5.php +++ b/backend/public/install/templates/step5.php @@ -35,7 +35,7 @@ $host = $_SERVER['HTTP_HOST']; 进入前台
- 进入后台 + 进入后台
diff --git a/docker/nginx/vhost.conf b/docker/nginx/vhost.conf index fdad80941..1496d5e02 100644 --- a/docker/nginx/vhost.conf +++ b/docker/nginx/vhost.conf @@ -6,6 +6,9 @@ server { root /var/www/public; + # 端口映射场景(宿主机 8011 -> 容器 80):目录补斜杠 301 使用相对 Location, + # 避免跳转后丢失宿主机映射端口 + absolute_redirect off; location / { # try_files $uri /index.php$is_args$args;