fix(nginx): defer CORS to gateway allowlist (#2861)

* fix(nginx): defer cors to gateway allowlist

Remove proxy-level wildcard CORS handling so browser origins are controlled by the Gateway allowlist and stay aligned with CSRF origin checks.

* docs: document gateway cors allowlist

Clarify that same-origin nginx access needs no CORS headers while split-origin or port-forwarded browser clients must opt in with GATEWAY_CORS_ORIGINS.

* docs(gateway): record cors source of truth

Document that Gateway CORSMiddleware and CSRFMiddleware share GATEWAY_CORS_ORIGINS as the split-origin source of truth.

* fix(gateway): align cors origin normalization

* docs: clarify gateway langgraph routing

* docs(gateway): update runtime routing note
This commit is contained in:
AochenShen99
2026-05-11 17:38:37 +08:00
committed by GitHub
parent 813d3c94ef
commit c3bc6c7cd5
14 changed files with 169 additions and 130 deletions
+22 -19
View File
@@ -14,28 +14,31 @@ DeerFlow is a LangGraph-based AI super agent with sandbox execution, persistent
│ │
/api/langgraph/* │ │ /api/* (other)
▼ ▼
┌────────────────────┐ ┌────────────────────────┐
LangGraph Server Gateway API (8001) │
(Port 2024) │ │ FastAPI REST
┌────────────────┐ │ │ Models, MCP, Skills,
│ Lead Agent │ │ │ Memory, Uploads,
┌──────────┐ │ │ │ Artifacts
│ │Middleware│ │ │ └────────────────────────┘
│ │ │ Chain │ │
│ │ ────────── │ │
│ │ ┌──────────┐ │
│ │ │ Tools │ │ │
│ │ └──────────┘ │ │
│ │ ┌──────────┐ │ │
│ │ │Subagents │ │
│ │ └──────────┘ │ │
────────────────┘
└────────────────────┘
┌──────────────────────────────────────────────┐
Gateway API (8001)
FastAPI REST + LangGraph-compatible runtime
│ │
Models, MCP, Skills, Memory, Uploads,
Artifacts, Threads, Runs, Streaming
┌────────────────┐ │
│ │ Lead Agent │
│ │ ──────────
│ │ │Middleware│ │
│ │ │ Chain │ │
│ │ └──────────┘ │
│ │ ┌──────────┐ │
│ │ │ Tools │ │
│ │ └──────────┘ │
│ ┌──────────┐ │
│ │ │Subagents │ │ │
│ │ └──────────┘ │ │
│ └────────────────┘ │
└──────────────────────────────────────────────┘
```
**Request Routing** (via Nginx):
- `/api/langgraph/*`LangGraph Server - agent interactions, threads, streaming
- `/api/langgraph/*`Gateway API - LangGraph-compatible agent interactions, threads, runs, and streaming translated to native `/api/*` routers
- `/api/*` (other) → Gateway API - models, MCP, skills, memory, artifacts, uploads, thread-local cleanup
- `/` (non-API) → Frontend - Next.js web interface