构建:新增完整容器化部署

This commit is contained in:
Zhu Junhao
2026-09-04 15:30:58 +08:00
parent 99d16bb3b9
commit 595c8da595
11 changed files with 335 additions and 31 deletions

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

@@ -0,0 +1,33 @@
server {
listen 80;
server_name _;
# 企业材料允许上传到 160 MB与 Spring Boot 的请求上限保持一致。
client_max_body_size 160m;
root /usr/share/nginx/html;
index index.html;
# 前后端保持同源,浏览器中的 Session Cookie、CSRF Token 与流式事件接口无需额外跨域配置。
location /api/ {
proxy_pass http://backend:8080;
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_set_header X-Forwarded-Proto $scheme;
# Agent 事件采用长连接流式返回,关闭代理缓冲后事件才能及时到达前端。
proxy_buffering off;
proxy_request_buffering off;
proxy_cache off;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
add_header X-Accel-Buffering no;
}
# Vue Router 使用 history 模式,未命中的前端路由统一回退到入口页面。
location / {
try_files $uri $uri/ /index.html;
}
}