I’m trying to set up Caddy to act as a reverse proxy for my home lab. I have Cloudflare working as DNS etc and have configured a tunnel to my lab.
If I set the public host name to go directly to the IP of one of my home lab hosts. It works fine.
If I change the destination to be the IP listed in my Caddyfile, it fails with a too many redirects error.
2. Error messages and/or full log output:
'''
* Connection #1 to host 1.littlei.net left intact
* Issue another request to this URL: 'https://1.littlei.net/'
* Found bundle for host: 0x5aa1c8e49bc0 [can multiplex]
* Re-using existing connection #1 with host 1.littlei.net
* h2h3 [:method: GET]
* h2h3 [:path: /]
* h2h3 [:scheme: https]
* h2h3 [:authority: 1.littlei.net]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* Using Stream ID: 99 (easy handle 0x5aa1c8e507a0)
> GET / HTTP/2
> Host: 1.littlei.net
> user-agent: curl/7.88.1
> accept: */*
>
< HTTP/2 308
< date: Thu, 07 Aug 2025 15:28:29 GMT
< content-length: 0
< location: https://1.littlei.net/
< server: cloudflare
< cf-cache-status: DYNAMIC
< nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
< report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=ScpN2bvVXVieDE%2FnaSgN9Wq3f4OZemNtJiOUwGDoN6R28ncp3BTYbCoVYxZYHl0tXHBiZp22NZwyk2%2BFv4naPYRTSBXrJwyaoADwY2dzbFaMY%2Fj1o7hj1Xk%3D"}]}
< cf-ray: 96b7cdd579d49445-LHR
< alt-svc: h3=":443"; ma=86400
<
* Connection #1 to host 1.littlei.net left intact
* Maximum (50) redirects followed
curl: (47) Maximum (50) redirects followed
'''
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
d. My complete Caddy config:
‘’’
{
debug
}
:80 {
\# Set this path to your site's directory.
root \* /usr/share/caddy
\# Enable the static file server.
file_server
\# Another common task is to set up a reverse proxy:
\# reverse_proxy localhost:8080
\# Or serve a PHP site through php-fpm:
\# php_fastcgi localhost:9000
Right now 1.littlei.net points to Cloudflare. Can you share how your Cloudflare setup is configured? Specifically, where is Cloudflare forwarding the traffic?
It looks like Cloudflare is sending traffic to Caddy on port 80 (HTTP), and Caddy is replying with an HTTP 308 redirect to HTTPS, causing a redirect loop. But that’s just my guess.
If that’s not the case, can you run these commands and share the output? Replace CADDY_IP with the actual IP address of your Caddy server.
[quote=“timelordx, post:2, topic:31718”]
I’m not sure I follow:
Thank you for your quick reply.
I have a Cloudflare ZeroTrust - tunnel to my network, with the tunnel configured so 1,littlei.net sends to the service http://192.168.1.12
Where 192.168.1.12 is the Caddy server address.
Please see the outputs from the commands requested below…