From ce8ff635d2cfe0e007fbb7cdbc5e91cccb46e0b7 Mon Sep 17 00:00:00 2001 From: wuyuan Date: Wed, 30 Sep 2026 10:25:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=85=8D=E5=90=88=20vite-press=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=20cleanUrls=20=E6=9B=B4=E6=96=B0=20?= =?UTF-8?q?try=5Ffiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx/default.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nginx/default.conf b/nginx/default.conf index d1afec83..f80e592a 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -11,7 +11,9 @@ server { client_max_body_size 50m; - try_files $uri $uri/ /docs/index.html; + # cleanUrls: true 的产物是平铺的 xxx.html,必须尝试 $uri.html, + # 否则所有干净 URL 都会兜底到首页 HTML,引发客户端水合错乱 + try_files $uri $uri.html $uri/ /docs/index.html; } }