# 运维控制台静态托管 + 反代网关 API(一个 URL 同时给前端与 /api)。 server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # SPA 路由:找不到文件回退 index.html(前端路由接管)。 location / { try_files $uri $uri/ /index.html; } # 网关 API:反代到 compose 网络内的 gateway 服务。 location /api/ { proxy_pass http://gateway: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; # SSE(token 流 / 执行轨迹):关闭缓冲 + 长超时,否则流式会被攒住/断开。 proxy_buffering off; proxy_cache off; proxy_read_timeout 1h; proxy_send_timeout 1h; } # 健康/指标直通(运维探活)。 location = /healthz { proxy_pass http://gateway:8080; } location = /readyz { proxy_pass http://gateway:8080; } }