fix(deploy): root path redirect to admin (cn) — persisted in template+compose

用户约定:32005 根路径打开即管理后台。之前是直接改在服务器容器配置上的,
历次镜像重建被冲掉——本次固化进仓库:nginx 模板 location = / → 302
${ROOT_REDIRECT};Dockerfile 默认 /admin/;compose 按栈注入(cn=/admin/,
ov=/index.html 观众端安全自指,不影响 /a/<token> 与嵌入路径)。

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-23 13:52:29 +08:00
parent d7ac9420be
commit 7ef27797ff
4 changed files with 12 additions and 0 deletions
+2
View File
@@ -60,6 +60,8 @@ FROM nginx:alpine
# 官方镜像启动时 envsubst 渲染 /etc/nginx/templates/*.template → conf.d;
# API_UPSTREAM 由 compose environment 注入(缺省指向 cn API 容器名)。
ENV API_UPSTREAM=http://api-cn:8080
# 根路径跳转目标(cn 默认进后台;ov 栈 compose 覆盖为 /index.html 安全自指)。
ENV ROOT_REDIRECT=/admin/
COPY infra/deploy/nginx.conf.template /etc/nginx/templates/default.conf.template
COPY --from=build /app/apps/viewer/dist /usr/share/nginx/html/viewer
COPY --from=build /app/apps/admin/dist /usr/share/nginx/html/admin