1. The problem I’m having:
I’m trying to have a caddy webserver hosting my static site on a separate server from my reverse proxy. The reverse proxy server proxiesa lot of other services, which are working. I can’t seem to get the caddy proxy to server working though.
I haven’t been able to access the static site through http from a different machine. I also haven’t been able to set up the reverse proxy and I don’t get what’s going wrong.
On my testing machine I could access the server using the same http://localhost/
config as I’m using now, but I can’t get it to work. I’ve also tried using :80
, http://docs.domain.tld
and http://:2020
. All of these either broke or didn’t work. I’ve also tried disabling tls globally and in my config itself.
When running the http://docs.domain.tld
, I get to many redirects. When running :80
, which doesn’t resolve with curl or the browser. When running http://:2020
, I also can’t resolve.
3. Caddy version:
2.10.0
4. How I installed and ran Caddy:
a. System environment:
I’m running both caddy instances from docker with the recommended compose files.
b. Command:
docker compose up -d
c. Service/unit/compose file:
services:
caddy:
image: caddy:2.10.0
restart: unless-stopped
ports:
- 80:80
- 443:443
- 443:443/udp
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./caddy/data:/data
- ./caddy/config:/config
- ./docs/site:/srv
d. My complete Caddy config:
Reverse proxy:
docs.domain.tld {
reverse_proxy 192.168.5.164
}
Webserver:
http://localhost {
root * /srv
file_server
}
5. Links to relevant resources:
The solutions I’ve tested came from multiple posts, this is the list: