1. Caddy version (caddy version
):
v2.2.0
2. How I run Caddy:
Using CaddyFile in /etc/caddy/Caddyfile
a. System environment:
Ubuntu 20.04.1 LTS
d. My complete Caddyfile or JSON config:
my-domain.com {
redir https://www.my-domain.com{uri}
}
https://*.my-domain.com, client-domain
# Set this path to your site's directory.
root * /<root_path>
# Enable the static file server.
file_server browse
@notStatic {
not path /static/*
}
reverse_proxy @notStatic localhost:8000
tls <email> {
on_demand
}
3. The problem I’m having:
I am trying to give the custom domain to a client who is using Cloudflare, when I used the domain directly in caddy file I got TOO_MANY_REDIRECTS and was not able to access it.
5. What I already tried:
I tried disabling theauto_https off
but that ended up showing a white page and not coming. This site was working fine on Nginx.