flowable-service:8089 无鉴权,裸 proxy_pass 对外会绕过网关超管门匿名部署/覆盖生产BPMN。 前端只经 /api/workflow/ 网关访问流程能力,/flowable/ 改 return 404。 High#2/Medium#3-4 等 A10 生产加固项记入计划 backlog(超管信任模型内可接受)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
49 lines
2.0 KiB
Nginx Configuration File
49 lines
2.0 KiB
Nginx Configuration File
# EIP4 单源托管(A10 W3)。挂载为 nginx:alpine 的 /etc/nginx/conf.d/default.conf。
|
|
# 一个源:静态 SPA(eip4-web/dist)+ 反代 /api→platform-app(唯一后端入口)。
|
|
# flowable-service:8089 无鉴权,绝不经 nginx 对外(见下 /flowable/ 说明)。
|
|
# 消除 dev 的 vite proxy 依赖;切流灰度(W6)可在此用 upstream 权重双跑(eip3↔eip4)。
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
# 附件上传/导出:放宽请求体上限(与保真层附件大小对齐,按需调)
|
|
client_max_body_size 50m;
|
|
|
|
gzip on;
|
|
gzip_types text/css application/javascript application/json image/svg+xml;
|
|
gzip_min_length 1024;
|
|
|
|
# 后端 REST(现代层 + 保真层引擎)
|
|
location /api/ {
|
|
proxy_pass http://platform-app:8084;
|
|
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;
|
|
proxy_read_timeout 130s; # 略大于 statement_timeout(120s),避免反代先于 DB 超时切断
|
|
}
|
|
|
|
# 🔴 工作流引擎(flowable-service:8089)绝不对外暴露。
|
|
# flowable-service 进程无 Spring Security,鉴权唯一落点=platform-app 网关的超管门
|
|
# (ProcessModelerController.requireSuperAdmin);裸直达 8089 会绕过所有鉴权,
|
|
# 匿名即可部署/覆盖生产 BPMN、办结/终止任意任务(安全评审 Critical#1)。
|
|
# 前端只经 /api/workflow/*(网关)访问流程能力,不需要 /flowable/ 直达。
|
|
# 若确需内网调试直达,改为 `internal;` 仅供内部子请求,严禁对公网 proxy_pass。
|
|
location /flowable/ {
|
|
return 404;
|
|
}
|
|
|
|
# 静态资源:带 hash 的构建产物可长缓存
|
|
location /assets/ {
|
|
root /usr/share/nginx/html;
|
|
expires 7d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# SPA:其余路由回退 index.html(amis 前端 history 路由)
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|