1. The problem I’m having:
Hi good people!
Long time Linux user, First time Caddy user.
I intend to use Caddy as reverse proxy to point to a small number of Docker containers running on my self-hosted server.
Initially, trying to configure Caddy using my domain from Cloudflare (to which I’ll refer as mydomain.com).
Cloudflare (A record) is configured, confirmed by reaching my page via mydomain.com when Caddyfile is left at :80.
My page is reachable from LAN, WAN and via curl when Caddyfile is left at :80, but when I change Caddyfile from :80 to mydomain.com as per instructions, it stops working (error below).
Please advise?
2. Error messages and/or full log output:
Error from web browser:
The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
Curl mydomain.com returns nothing when Caddyfile is pointed at mydomain, returns properly when Caddyfile is pointed at :80.
3. Caddy version:
v2.9.1
4. How I installed and ran Caddy:
a. System environment:
Linux raspberrypi 6.6.74+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.74-1+rpt1 (2025-01-27) aarch64 GNU/Linux
b. Command:
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf '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
c. Service/unit/compose file:
Directly (systemctl service) as default after installation.
d. My complete Caddy config:
Version that doesn’t work:
mydomain.com {
respond "Website under construction"
}
Version that does work:
:80 {
respond "Website under construction"
}