1. Caddy version (2.1.1
):
2. How I run Caddy:
Installed with repository. Started with systemd. And using caddyfile. Reverse proxy is set for different applications. Never had an error.
a. System environment:
Rock64 or RPI3 (tested both, but not at the same time) Debian buster based DietPi. arm64 and armhf.
b. Commands
systemctl restart caddy.service
c. Service/unit/compose file:
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target
[Service]
User=caddy
Group=root
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy$
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddy$
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config:
#runs smooth:
domain1.com {
file_server
encode zstd gzip
reverse_proxy 192.168.178.32:3000
}
#this one has trouble
domain2.com {
reverse_proxy /_matrix/* http://192.168.178.27:8008
}
3. The problem I’m having:
On domain1 runs a rocket.chat, it works perfectly. But I want to replace it with Matrix-Synapse. Actual they are running parallel but on different sbc’s.
I modified the caddyfile example from the Matrix docs, because I dont want to use the federation features.
matrix.example.com {
reverse_proxy /_matrix/* http://localhost:8008
}
example.com:8448 {
reverse_proxy http://localhost:8008
}
The only trouble here is: If I try to connect to the .com-domain from inside my network it doesnt work. From the inside of my network, only the localhost ip works. If I leave my network, the .com-Domain runs perfect.
I have never seen something before, and didnt have this mess with the rocket.chat one.
I am not clear if this is a caddy specific error, but there must be a way to get this running, because it smells like a reverse proxy fail.
4. Error messages and/or full log output:
Found no error messages for this.
5. What I already tried:
- Tried to set my domain in /etc/hosts
- checked networking in Browser, ends with dns-resolution, no connection buildup.
- deactivate pi-hole and unbound (runs on another sbc)
- changed the dns-resolver on the matrix-sbc from my own to a third-party one, quad9.
- Commented all tls settings out in synapse config, because of caddy using.
- ping domain2.com from internal network runs with no errors.
- cleared Browser cache, tried different browsers.
- added “file_server” to caddyfile, nothing changed.
Element-App couldnt connect to the external-Domain from inside of my network, too. So it is not a browser fault. Any ideas what could be wrong?