From e75950259a3729945de997fd65d9b23cf653c6c3 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Tue, 13 Oct 2026 02:53:57 -0400 Subject: [PATCH] =?UTF-8?q?=E3=80=90issues/9358=E3=80=91docker=E9=83=A8?= =?UTF-8?q?=E7=BD=B2AI=E5=BA=94=E7=94=A8=E6=8F=92=E4=BB=B6=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=8A=A5Connection=20refused=EF=BC=9Anginx=E8=BD=AC?= =?UTF-8?q?=E5=8F=91Host=E8=A1=A5=E5=85=A8=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 前端nginx转发时Host不带端口,后端getBaseUrl取到默认80端口, endpoint为空的AI插件(如商品导购)等自调用拼出 http://jeecg-boot-system/jeecg-boot 导致连接失败。 - Dockerfile:Host 改为 jeecg-boot-system:8080 - Dockerfile.cloud:Host 改为网关 jeecg-boot-gateway:9999,网关据此生成正确的 X_GATEWAY_BASE_PATH Co-Authored-By: Claude Opus 5.5 --- jeecgboot-vue3/Dockerfile | 3 ++- jeecgboot-vue3/Dockerfile.cloud | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/jeecgboot-vue3/Dockerfile b/jeecgboot-vue3/Dockerfile index b42385a06..f42a7774f 100644 --- a/jeecgboot-vue3/Dockerfile +++ b/jeecgboot-vue3/Dockerfile @@ -11,7 +11,8 @@ RUN echo "server { \ rewrite ^/jeecgboot/?(.*)\$ /jeecg-boot/\$1 break; \ proxy_pass http://\$jeecg_system:8080; \ proxy_redirect off; \ - proxy_set_header Host jeecg-boot-system; \ + #Host需带端口,否则后端getBaseUrl拿到默认80端口,AI插件等自调用失败 issues/9358 \ + proxy_set_header Host jeecg-boot-system:8080; \ proxy_set_header X-Real-IP \$remote_addr; \ proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \ } \ diff --git a/jeecgboot-vue3/Dockerfile.cloud b/jeecgboot-vue3/Dockerfile.cloud index 5874e9bc6..4246b53be 100644 --- a/jeecgboot-vue3/Dockerfile.cloud +++ b/jeecgboot-vue3/Dockerfile.cloud @@ -11,7 +11,8 @@ RUN echo "server { \ rewrite ^/jeecgboot/?(.*)\$ /\$1 break; \ proxy_pass http://\$jeecg_gateway:9999; \ proxy_redirect off; \ - proxy_set_header Host jeecg-boot-system; \ + #Host需为网关地址带端口,网关据此生成X_GATEWAY_BASE_PATH,否则AI插件等自调用失败 issues/9358 \ + proxy_set_header Host jeecg-boot-gateway:9999; \ proxy_set_header X-Real-IP \$remote_addr; \ proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \ } \