fix(nginx): fix admin SPA routing fallback to correct index.html

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 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-06 23:24:22 -08:00
parent e16ec7930d
commit fc9e0cd17b
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ server {
location /admin { location /admin {
alias /usr/share/nginx/html/admin; alias /usr/share/nginx/html/admin;
index index.html; 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)$ { location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {