Cloudflare > Caddy V2 > Runcloud Success

I’ve been able to successfully get Caddy setup and running as a “middle-man” between Cloudflare and a Ubuntu server being managed by Runcloud.io.

Using website.com as our example:

Caddy server running at IP 1.2.3.4
Ubuntu server running at IP 5.6.7.8

Domain settings at Cloudflare:

  • DNS Entries proxied and pointed at our Caddy IP of 1.2.3.4
  • Under SSL/TLS > Overview, set option to Full

Caddyfile entry on Caddy server:

website.com, www.website.com {
    tls internal
    reverse_proxy 5.6.7.8:80
}

Application entry for website.com on Ubuntu (managed by Runcloud.io):

  • Under SSL/TLS, generate a new Let’s Encrypt cert
  • Use http-01 authorization
  • Use No Redirection

The above example will load your domain successfully using a Cloudflare IP.