From f265db46ca38758739c36e30f9105a88b99e4be9 Mon Sep 17 00:00:00 2001 From: kkfluous Date: Wed, 29 Apr 2026 18:35:08 +0800 Subject: [PATCH] fix(deploy): serve under /xll-bi/ prefix and bump host port to 8214 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverse proxy at demo-ctx.lnh2e.com forwards /xll-bi/* unchanged to the container, so the container's nginx must match that location and Vite must build asset URLs under the same prefix — otherwise the SPA shell returns 404 and the JS/CSS resolve to /assets/* with no handler. - nginx.conf: rename location /bi/ → /xll-bi/ (and assets sub-location) - vite.config.ts: set base: '/xll-bi/' so built index.html references /xll-bi/assets/* - docker-compose.yml: 8114 → 8214 to match the upstream the proxy targets Co-Authored-By: Claude Opus 4.7 (1M context) --- docker-compose.yml | 2 +- nginx.conf | 6 +++--- vite.config.ts | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d2cf2c4..ad8f121 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: bi: image: harbor.lnh2e.com/lingniu-v1/bi:main-0.0.0 ports: - - "8114:80" + - "8214:80" deploy: replicas: 1 restart_policy: diff --git a/nginx.conf b/nginx.conf index 7a71826..081dc28 100644 --- a/nginx.conf +++ b/nginx.conf @@ -4,12 +4,12 @@ server { root /usr/share/nginx/html; index index.html; - location /bi/ { + location /xll-bi/ { alias /usr/share/nginx/html/; - try_files $uri $uri/ /bi/index.html; + try_files $uri $uri/ /xll-bi/index.html; } - location /bi/assets/ { + location /xll-bi/assets/ { alias /usr/share/nginx/html/assets/; expires 1y; add_header Cache-Control "public, immutable"; diff --git a/vite.config.ts b/vite.config.ts index 0506f1b..81a1f73 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,6 +6,7 @@ import {defineConfig, loadEnv} from 'vite'; export default defineConfig(({mode}) => { const env = loadEnv(mode, '.', ''); return { + base: '/xll-bi/', plugins: [react(), tailwindcss()], define: { 'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY),