Menu

FastAPI LLM Gateway on Cloudflare Tunnel, Zero Open Ports
📰

FastAPI LLM Gateway on Cloudflare Tunnel, Zero Open Ports

DEV Community: fastapi·Aivlyn·3 days ago
#RaLcPwRt
#devtofastapi#devto#dev#cloudflare#gateway
Long article (2820 words) — no AI summary yet.
Reading 0:00
15s threshold

Somebody is probably scanning your server right now. Public IPs get probed constantly, and an LLM endpoint is a juicy target because every request burns your GPU or your API bill. The usual fix is a firewall full of exceptions. There is a quieter option: close every inbound port and let the server dial out to Cloudflare instead. We built a small FastAPI gateway with keys, logging and rate limits, tested it, and wired it to a tunnel. Here is the whole recipe, including what we could not verify.

Key takeaways

Outbound Only: cloudflared dials out to Cloudflare, so the host can block all inbound traffic.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.