🎨 更新环境配置,添加 Dockerfile,优化代码结构

This commit is contained in:
2026-04-21 22:09:19 +08:00
parent 81d8466f88
commit 5c2a146a44
35 changed files with 6396 additions and 141 deletions

33
web-admin/nginx.conf Normal file
View File

@@ -0,0 +1,33 @@
server {
listen 80;
server_name _;
# 文件上传大小限制 50MB
client_max_body_size 50m;
root /usr/share/nginx/html;
index index.html;
# 将 /api/ 请求反代到后端(去掉 /api 前缀,与 vite dev proxy 行为一致)
location /api/ {
proxy_pass http://server:8888/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 35s;
proxy_send_timeout 35s;
proxy_connect_timeout 10s;
}
# SPA fallback所有非文件路径返回 index.html
location / {
try_files $uri $uri/ /index.html;
}
# 静态资源缓存
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
expires 7d;
add_header Cache-Control "public, immutable";
}
}