RTX 3050 - Order Now
Home / Blog / Tutorials / Caddy Reverse Proxy for Ollama Setup
Tutorials

Caddy Reverse Proxy for Ollama Setup

Caddy automates TLS and has a dead-simple config format. For a small Ollama deployment, it is a lower-friction alternative to nginx.

Caddy is a reverse proxy with automatic HTTPS via Let’s Encrypt and a config format an order of magnitude simpler than nginx. For a single-service Ollama deployment on our dedicated GPU hosting, Caddy is often the right tool.

Contents

Install

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -fsSL https://dl.cloudsmith.io/public/caddy/stable/gpg.key | \
  sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt | \
  sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy

Caddyfile

api.yourdomain.com {
    reverse_proxy localhost:11434 {
        flush_interval -1
        transport http {
            read_timeout 1h
            write_timeout 1h
        }
    }
}

That’s it. Caddy handles certificate issuance and renewal automatically. flush_interval -1 disables output buffering – required for SSE streaming. Timeouts accommodate long LLM responses.

Auth

Simple token auth:

api.yourdomain.com {
    @authorized header Authorization "Bearer your-secret-key"
    handle @authorized {
        reverse_proxy localhost:11434 {
            flush_interval -1
        }
    }
    respond 401
}

More sophisticated: use Caddy’s built-in basic auth or plug in an external OIDC module.

Versus nginx

ConcernCaddynginx
Config complexityVery lowModerate
TLSAutomaticManual / certbot
PerformanceGoodSlightly better at scale
EcosystemSmallerLarger

For single-service simple deployments, pick Caddy. For complex multi-service routing or when your ops team already uses nginx, stick with nginx.

Ollama on UK Dedicated Hosting

Caddy + Ollama preconfigured with TLS and domain routing.

Browse GPU Servers

See nginx config and Ollama behind Cloudflare Tunnel.

Need a Dedicated GPU Server?

Deploy from RTX 3050 to RTX 5090. Full root access, NVMe storage, 1Gbps — UK datacenter.

Browse GPU Servers

admin

We benchmark, deploy, and optimise GPU infrastructure for AI workloads. All data in our guides comes from real-world testing on our UK-based dedicated GPU servers.

Ready to deploy your AI workload?

Dedicated GPU servers from our UK datacenter. NVMe storage, 1Gbps networking, full root access.

Browse GPU Servers Contact Sales

Have a question? Need help?