准备部署

This commit is contained in:
AgentLabCn
2026-06-15 21:21:20 +08:00
parent 4167714149
commit 6c22cf9ef7
17 changed files with 898 additions and 2 deletions
+28
View File
@@ -0,0 +1,28 @@
# 青叶前端容器 Nginx 配置(提供 SPA 静态文件)
# 仅负责静态资源与前端路由回退;API / WebSocket / 上传文件由「宿主机 Nginx」转发到后端。
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# gzip 压缩
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css application/json application/javascript application/xml text/xml application/xml+rss text/javascript image/svg+xml;
# SPA 路由回退:Vue Router 使用 createWebHistoryHTML5 history 模式),
# 刷新 /chat、/moments 等前端路由时需回退到 index.html
location / {
try_files $uri $uri/ /index.html;
}
# 静态资源长缓存(Vite 产物带 hash 文件名,可安全强缓存)
location ~* \.(?:js|css|woff2?|ttf|eot|png|jpg|jpeg|gif|ico|svg)$ {
expires 30d;
add_header Cache-Control "public, immutable";
access_log off;
}
}