From 76b646b208c6b112bc1d811adf98eee0470bf5e3 Mon Sep 17 00:00:00 2001 From: ddCat <2695092045@qq.com> Date: Fri, 11 Sep 2026 14:32:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20=E6=AC=A2=E8=BF=8E=E9=A1=B5=20-=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20welcome=20=E8=B7=AF=E7=94=B1=20403=20?= =?UTF-8?q?=E4=B8=8E=E7=AB=AF=E5=8F=A3=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nginx.conf b/nginx.conf index 594a4161a..4894c6d73 100644 --- a/nginx.conf +++ b/nginx.conf @@ -144,6 +144,16 @@ server { try_files /index.html =404; } + # /welcome 是 React 路由,同时也是欢迎页静态素材目录;精确命中路由时优先回退到 SPA, + # 避免 Nginx 把目录当作文件列表并返回 403,或生成带容器端口的 301。 + location = /welcome { + try_files /index.html =404; + } + + location = /welcome/ { + try_files /index.html =404; + } + location / { try_files $uri $uri/ /index.html; }