1. Caddy version:
2.6.4
2. How I installed, and run Caddy:
docker
a. System environment:
docker
b. Command:
Paste command here.
c. Service/unit/compose file:
version: "3.7"
services:
caddy:
image: caddy:latest
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- $PWD/Caddyfile:/etc/caddy/Caddyfile
- $PWD/site:/srv
networks:
priv_lan:
ipv4_address: 192.168.1.11
networks:
# The priv_lan network is already setup, so it is an 'external' network
priv_lan:
external:
name: priv_lan
d. My complete Caddy config:
{
auto_https off
}
x.home.lan {
reverse_proxy 192.168.1.205:5000
}
3. The problem I’m having:
I would like to use Caddy in my local network as reverse proxy. In Adguard home I set DNS rewrite: *.home.lan → 192.168.1.11. So any subdomain at *.home.lan resolves to Caddy’s IP address. I do not need https, so I disabled it. I set ipv4_address, because I would like that the container shows up as a real IP on my local network.
After bringing docker-compose up, I can ping Caddy’s IP, but that’s all, I can’t access services defined in the Caddyfile.
4. Error messages and/or full log output:
mihalkoadrian@Adrian-MacBook-Pro ~ % curl http://x.home.lan
curl: (7) Failed to connect to x.home.lan port 80 after 74 ms: Couldn't connect to server
mihalkoadrian@Adrian-MacBook-Pro ~ % dig x.home.lan
; <<>> DiG 9.10.6 <<>> x.home.lan
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44224
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;x.home.lan. IN A
;; ANSWER SECTION:
x.home.lan. 10 IN A 192.168.1.11
madrian@debian:~/docker/caddy$ docker-compose up
Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
Starting caddy_caddy_1 ... done
Attaching to caddy_caddy_1
caddy_1 | {"level":"info","ts":1676500201.4216044,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
caddy_1 | {"level":"warn","ts":1676500201.424177,"msg":"Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":2}
caddy_1 | {"level":"info","ts":1676500201.4265282,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//127.0.0.1:2019","//localhost:2019","//[::1]:2019"]}
caddy_1 | {"level":"warn","ts":1676500201.427776,"logger":"http","msg":"automatic HTTPS is completely disabled for server","server_name":"srv0"}
caddy_1 | {"level":"info","ts":1676500201.42843,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
caddy_1 | {"level":"info","ts":1676500201.428868,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size for details."}
caddy_1 | {"level":"info","ts":1676500201.4293804,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
caddy_1 | {"level":"info","ts":1676500201.4301066,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
caddy_1 | {"level":"info","ts":1676500201.4305398,"msg":"serving initial configuration"}
caddy_1 | {"level":"info","ts":1676500201.4311547,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00040b420"}
caddy_1 | {"level":"info","ts":1676500201.4316404,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data/caddy"}
caddy_1 | {"level":"info","ts":1676500201.4320703,"logger":"tls","msg":"finished cleaning storage units"}