Deployment Presets
Python FastAPI + Gunicorn/Uvicorn Workers in CloudPanel
Run production FastAPI microservices behind CloudPanel Nginx with systemd-managed Uvicorn workers, Unix domain sockets, and buffered body limits.
4x Uvicorn Workers · Unix Socket · <4 ms Nginx Proxy Hop
Pairing Static Marketing Frontends With FastAPI Backends
CloudPanel excels at hosting a WordPress or static landing site on the root domain while proxying /api/ requests via a location block directly to an isolated Gunicorn/Uvicorn Unix socket.
Proxy Buffering for Streaming Endpoints
For Server-Sent Events (SSE) or streaming LLM responses on FastAPI, add proxy_buffering off; inside the specific API location block so chunks flush immediately to clients.
Measured Parameters & CloudPanel Stack Directives
| Parameter / Setting | Recommended Value | Operational Reason |
|---|---|---|
| Worker Formula | (2 x vCPU) or 1/core for async I/O | Avoids Python GIL contention while saturating multi-core NVMe |
| Transport Binding | Unix socket /run/fastapi-app.sock | Eliminates TCP ephemeral port exhaustion under high RPS |
| Nginx Timeouts | proxy_read_timeout 120s | Prevents premature 504 errors on streaming AI or export routes |
| Environment Isolation | Dedicated site user + .venv | Isolates Python dependencies per tenant directory |