- 项目详情接口 _count 漏 select modules,重新导入弹框因此显示「undefined 个模块」 - 重新导入不再用文档中的 name/description 覆盖用户自行设置的项目名称与描述 - URL 抓取失败原因此前被完全吞掉,只剩无信息量的 502:前端改为预判混合内容、 跳过必然超时的内网服务端代理、直连加超时,并抛出带错误码的 SpecFetchError - 服务端代理加 15s 超时并始终返回 JSON,不再挂到 nginx 超时返回 HTML 错误页 - 新增 SpecFetchErrorNotice 组件,跨域类失败时可展开具体的 CORS 配置引导 - nginx /api/ 补 client_max_body_size 12m,避免大文档在 nginx 层被 413 挡掉 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
47 lines
1.4 KiB
Nginx Configuration File
47 lines
1.4 KiB
Nginx Configuration File
server {
|
||
listen 80;
|
||
root /usr/share/nginx/html;
|
||
index index.html;
|
||
|
||
location /api/ {
|
||
# OpenAPI 文档整份提交,默认 1m 上限会被大文档打爆(server 侧允许 10mb)
|
||
client_max_body_size 12m;
|
||
proxy_read_timeout 120s;
|
||
proxy_pass http://server:3000;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
}
|
||
|
||
location /mcp/ {
|
||
proxy_pass http://mcp:3001;
|
||
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_http_version 1.1;
|
||
proxy_set_header Connection '';
|
||
proxy_buffering off;
|
||
proxy_cache off;
|
||
}
|
||
|
||
location /docs/ {
|
||
proxy_pass http://docs:80/;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
}
|
||
|
||
# Hashed build artifacts are safe to cache forever
|
||
location /assets/ {
|
||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||
try_files $uri =404;
|
||
}
|
||
|
||
location / {
|
||
# index.html must always revalidate, or browsers keep a stale
|
||
# bundle reference after each deploy (heuristic caching)
|
||
add_header Cache-Control "no-cache";
|
||
try_files $uri $uri/ /index.html;
|
||
}
|
||
}
|