feat: 新增 node-frontend-react-class 示例(React 19 类组件,Tengine 托管)

This commit is contained in:
2026-11-15 11:57:21 +08:00
parent 90c3334368
commit cd1c155256
18 changed files with 632 additions and 0 deletions
@@ -0,0 +1,29 @@
# node-frontend-react-class 站点:Tengine 3.1.0 托管 React 构建产物(纯静态,无后端依赖)
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;
}
# 前端路由兜底:示例不引入路由库,保留是为了以后加 react-router 时不用改配置
location / {
try_files $uri $uri/ /index.html;
}
# 健康检查:直接读 index.html
location = /healthz {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
}