server { listen 80; server_name localhost; root /app; index index.html; # SPA 路由支持 location / { try_files $uri $uri/ /index.html; } # 静态资源缓存 location /assets/ { expires 1y; add_header Cache-Control "public, immutable"; } # 健康检查端点 location /health { access_log off; return 200 "ok"; add_header Content-Type text/plain; } }