feat: 新增 node-frontend-vite5 示例(Vite 5 + Vue 3,Tengine 托管)

This commit is contained in:
2026-11-15 11:53:02 +08:00
parent 92a57d99a0
commit 90c3334368
15 changed files with 432 additions and 0 deletions
@@ -0,0 +1,29 @@
# node-frontend-vite5 站点:Tengine 3.1.0 托管 Vite 5 + Vue 3 构建产物(纯静态,无后端依赖)
server {
listen 80;
server_name _;
access_log /dev/stdout main;
root /usr/local/nginx/html;
index index.html;
# 静态资源带 hash,长缓存;index.html 每次重新验证,保证发版后立即生效
location /assets/ {
expires 30d;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
# 前端路由兜底:单页示例用不到,保留是为了以后切 history 模式时不用改配置
location / {
try_files $uri $uri/ /index.html;
}
# 健康检查:直接读 index.html
location = /healthz {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
}