From fc9e0cd17b7fde993dc1e19b299f2203801f7546 Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 6 Feb 2026 23:24:22 -0800 Subject: [PATCH] fix(nginx): fix admin SPA routing fallback to correct index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit try_files 的最后一项 /index.html 会落到 web-client 的根 index.html, 导致 /admin/* 子路由(如 /admin/knowledge)加载 web-client 而非 admin-client。 修改为 /admin/index.html 以正确返回管理后台的 SPA 入口。 Co-Authored-By: Claude Opus 4.6 --- nginx/conf.d/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index 6bc94d3..e73043b 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -41,7 +41,7 @@ server { location /admin { alias /usr/share/nginx/html/admin; index index.html; - try_files $uri $uri/ /index.html; + try_files $uri $uri/ /admin/index.html; # 缓存静态资源 location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {