1. Caddy version:
2.6.2
2. How I installed, and run Caddy:
Official installation
a. System environment:
Ubuntu Server
b. Command:
systemctl start caddy.service
c. Service/unit/compose file:
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddy config:
(trustedproxy) {
trusted_proxies 172.16.0.0/24 173.245.48.0/20 103.21.244.0/22 103.22.200.0/22 103.31.4.0/22 141.101.64.0/18 108.162.192.0/18 190.93.240.0/20 188.114.96.0/20 197.234.240.0/22 198.41.128.0/17 162.158.0.0/15 104.16.0.0/13 104.24.0.0/14 172.64.0.0/13 131.0.72.0/22>
}
eschbach.house {
header /.well-known/matrix/* Content-Type application/json
header /.well-known/matrix/* Access-Control-Allow-Origin *
respond /.well-known/matrix/server `{"m.server": "matrix.eschbach.house:443"}`
respond /.well-known/matrix/client `{"m.homeserver":{"base_url":"https://matrix.eschbach.house"},"m.identity_server":{"base_url":"https://identity.eschbach.house"}}`
}
matrix.eschbach.house {
reverse_proxy /_matrix/* 172.16.0.231:8008 {import trustedproxy}
reverse_proxy /_synapse/client/* 172.16.0.231:8008 {import trustedproxy}
}
3. The problem I’m having:
Server is up and running, but having issues with federation. The federationtester.matrix.org site says I have no .well-known but I have exactly was was put in the docs.
4. Error messages and/or full log output:
Feb 04 18:17:17 caddy caddy[146]: {"level":"error","ts":1675556237.3614252,"logger":"http.log.error","msg":"dial tcp: lookup trustedproxy}: no such host","request":{"remote_ip":"172.70.131.161","remote_port":"41514","proto":"HTTP/2.0","method":"GET","host":"matrix.eschbach.house","uri":"/_matrix/client/versions","headers":{"Accept-Encoding":["gzip"],"Cf-Ray":["794776533f328101-ORD"],"X-Forwarded-Proto":["https"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Origin":["https://app.element.io"],"Accept-Language":["en-US"],"Cf-Connecting-Ip":["75.168.220.4"],"Cf-Ipcountry":["US"],"Cdn-Loop":["cloudflare"],"X-Forwarded-For":["75.168.220.4"],"Accept":["application/json"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15 Tangram/2.0"],"Cache-Control":["max-age=0"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matrix.eschbach.house"}},"duration":0.00015394,"status":502,"err_id":"xuhfagpvz","err_trace":"reverseproxy.statusError (reverseproxy.go:1272)"}
Feb 04 18:17:22 caddy caddy[146]: {"level":"error","ts":1675556242.5334344,"logger":"http.log.error","msg":"dial tcp: lookup trustedproxy}: no such host","request":{"remote_ip":"172.70.131.162","remote_port":"21214","proto":"HTTP/2.0","method":"GET","host":"matrix.eschbach.house","uri":"/_matrix/client/versions","headers":{"Origin":["https://app.element.io"],"Cache-Control":["max-age=0"],"Accept-Language":["en-US"],"Cf-Connecting-Ip":["75.168.220.4"],"Cdn-Loop":["cloudflare"],"Accept-Encoding":["gzip"],"Accept":["application/json"],"X-Forwarded-Proto":["https"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15 Tangram/2.0"],"Cf-Ipcountry":["US"],"X-Forwarded-For":["75.168.220.4"],"Cf-Ray":["7947767388fe8101-ORD"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matrix.eschbach.house"}},"duration":0.000137496,"status":502,"err_id":"cbhk84fvc","err_trace":"reverseproxy.statusError (reverseproxy.go:1272)"}
Feb 04 18:17:30 caddy caddy[146]: {"level":"error","ts":1675556250.0287037,"logger":"http.log.error","msg":"dial tcp: lookup {import: no such host","request":{"remote_ip":"172.70.131.161","remote_port":"27110","proto":"HTTP/2.0","method":"GET","host":"matrix.eschbach.house","uri":"/_matrix/client/versions","headers":{"Origin":["https://app.element.io"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15 Tangram/2.0"],"Cache-Control":["max-age=0"],"Cf-Connecting-Ip":["75.168.220.4"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Accept":["application/json"],"Accept-Encoding":["gzip"],"X-Forwarded-For":["75.168.220.4"],"Cf-Ray":["794776a268bb8101-ORD"],"X-Forwarded-Proto":["https"],"Accept-Language":["en-US"],"Cf-Ipcountry":["US"],"Cdn-Loop":["cloudflare"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matrix.eschbach.house"}},"duration":0.000159694,"status":502,"err_id":"0piruwcvh","err_trace":"reverseproxy.statusError (reverseproxy.go:1272)"}
Feb 04 18:17:37 caddy caddy[146]: {"level":"error","ts":1675556257.9552946,"logger":"http.log.error","msg":"dial tcp: lookup trustedproxy}: no such host","request":{"remote_ip":"172.70.131.161","remote_port":"27110","proto":"HTTP/2.0","method":"GET","host":"matrix.eschbach.house","uri":"/_matrix/client/r0/sync?filter=0&timeout=30000&since=s20_76_0_1_10_1_1_15_0_1","headers":{"Cf-Visitor":["{\"scheme\":\"https\"}"],"Origin":["https://app.element.io"],"Cf-Ipcountry":["US"],"Cf-Ray":["794776d429fe8101-ORD"],"X-Forwarded-Proto":["https"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15 Tangram/2.0"],"Cf-Connecting-Ip":["75.168.220.4"],"Accept-Encoding":["gzip"],"X-Forwarded-For":["75.168.220.4"],"Authorization":[],"Cdn-Loop":["cloudflare"],"Cache-Control":["max-age=0"],"Accept-Language":["en-US"],"Accept":["application/json"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matrix.eschbach.house"}},"duration":0.000102002,"status":502,"err_id":"83772xte6","err_trace":"reverseproxy.statusError (reverseproxy.go:1272)"}
Feb 04 18:17:43 caddy caddy[146]: {"level":"error","ts":1675556263.5836112,"logger":"http.log.error","msg":"dial tcp: lookup {import: no such host","request":{"remote_ip":"172.70.131.161","remote_port":"41514","proto":"HTTP/2.0","method":"GET","host":"matrix.eschbach.house","uri":"/_matrix/client/versions","headers":{"X-Forwarded-For":["75.168.220.4"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15 Tangram/2.0"],"Accept-Language":["en-US"],"Accept-Encoding":["gzip"],"Cdn-Loop":["cloudflare"],"Cf-Ray":["794776f74fb38101-ORD"],"X-Forwarded-Proto":["https"],"Accept":["application/json"],"Origin":["https://app.element.io"],"Cache-Control":["max-age=0"],"Cf-Connecting-Ip":["75.168.220.4"],"Cf-Ipcountry":["US"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matrix.eschbach.house"}},"duration":0.000104638,"status":502,"err_id":"y2vcaavq4","err_trace":"reverseproxy.statusError (reverseproxy.go:1272)"}
Feb 04 18:17:51 caddy caddy[146]: {"level":"error","ts":1675556271.036854,"logger":"http.log.error","msg":"dial tcp: lookup trustedproxy}: no such host","request":{"remote_ip":"172.70.131.162","remote_port":"21214","proto":"HTTP/2.0","method":"GET","host":"matrix.eschbach.house","uri":"/_matrix/client/versions","headers":{"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15 Tangram/2.0"],"Cdn-Loop":["cloudflare"],"Accept-Encoding":["gzip"],"X-Forwarded-For":["75.168.220.4"],"X-Forwarded-Proto":["https"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Accept":["application/json"],"Origin":["https://app.element.io"],"Cache-Control":["max-age=0"],"Accept-Language":["en-US"],"Cf-Connecting-Ip":["75.168.220.4"],"Cf-Ipcountry":["US"],"Cf-Ray":["79477725eab78101-ORD"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matrix.eschbach.house"}},"duration":0.000107385,"status":502,"err_id":"m3ua9xp31","err_trace":"reverseproxy.statusError (reverseproxy.go:1272)"}
Feb 04 18:17:43 caddy caddy[146]: {"level":"error","ts":1675556263.5836112,"logger":"http.log.error","msg":"dial tcp: lookup {import: no such host","request":{"remote_ip":"172.70.131.161","remote_port":"41514","proto":"HTTP/2.0","method":"GET","host":"matrix.eschbach.house","uri":"/_matrix/client/versions","headers":{"X-Forwarded-For":["75.168.220.4"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15 Tangram/2.0"],"Accept-Language":["en-US"],"Accept-Encoding":["gzip"],"Cdn-Loop":["cloudflare"],"Cf-Ray":["794776f74fb38101-ORD"],"X-Forwarded-Proto":["https"],"Accept":["application/json"],"Origin":["https://app.element.io"],"Cache-Control":["max-age=0"],"Cf-Connecting-Ip":["75.168.220.4"],"Cf-Ipcountry":["US"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matrix.eschbach.house"}},"duration":0.000104638,"status":502,"err_id":"y2vcaavq4","err_trace":"reverseproxy.statusError (reverseproxy.go:1272)"}
Feb 04 18:17:51 caddy caddy[146]: {"level":"error","ts":1675556271.036854,"logger":"http.log.error","msg":"dial tcp: lookup trustedproxy}: no such host","request":{"remote_ip":"172.70.131.162","remote_port":"21214","proto":"HTTP/2.0","method":"GET","host":"matrix.eschbach.house","uri":"/_matrix/client/versions","headers":{"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15 Tangram/2.0"],"Cdn-Loop":["cloudflare"],"Accept-Encoding":["gzip"],"X-Forwarded-For":["75.168.220.4"],"X-Forwarded-Proto":["https"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Accept":["application/json"],"Origin":["https://app.element.io"],"Cache-Control":["max-age=0"],"Accept-Language":["en-US"],"Cf-Connecting-Ip":["75.168.220.4"],"Cf-Ipcountry":["US"],"Cf-Ray":["79477725eab78101-ORD"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matrix.eschbach.house"}},"duration":0.000107385,"status":502,"err_id":"m3ua9xp31","err_trace":"reverseproxy.statusError (reverseproxy.go:1272)"}
Feb 04 18:17:56 caddy caddy[146]: {"level":"error","ts":1675556276.573587,"logger":"http.log.error","msg":"dial tcp: lookup {import: no such host","request":{"remote_ip":"172.70.131.161","remote_port":"27110","proto":"HTTP/2.0","method":"GET","host":"matrix.eschbach.house","uri":"/_matrix/client/versions","headers":{"Cf-Ipcountry":["US"],"Accept-Encoding":["gzip"],"X-Forwarded-For":["75.168.220.4"],"X-Forwarded-Proto":["https"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Origin":["https://app.element.io"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15 Tangram/2.0"],"Cache-Control":["max-age=0"],"Accept-Language":["en-US"],"Cf-Connecting-Ip":["75.168.220.4"],"Cdn-Loop":["cloudflare"],"Cf-Ray":["7947774888338101-ORD"],"Accept":["application/json"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matrix.eschbach.house"}},"duration":0.000093013,"status":502,"err_id":"dhc2jczyn","err_trace":"reverseproxy.statusError (reverseproxy.go:1272)"}
Feb 04 18:18:02 caddy caddy[146]: {"level":"error","ts":1675556282.0598867,"logger":"http.log.error","msg":"dial tcp: lookup {import: no such host","request":{"remote_ip":"172.70.131.161","remote_port":"41514","proto":"HTTP/2.0","method":"GET","host":"matrix.eschbach.house","uri":"/_matrix/client/versions","headers":{"Cf-Ipcountry":["US"],"X-Forwarded-For":["75.168.220.4"],"X-Forwarded-Proto":["https"],"Accept":["application/json"],"Cache-Control":["max-age=0"],"Cf-Connecting-Ip":["75.168.220.4"],"Cdn-Loop":["cloudflare"],"Accept-Encoding":["gzip"],"Cf-Ray":["7947776acb788101-ORD"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Origin":["https://app.element.io"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15 Tangram/2.0"],"Accept-Language":["en-US"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matrix.eschbach.house"}},"duration":0.000099193,"status":502,"err_id":"3k11x5nts","err_trace":"reverseproxy.statusError (reverseproxy.go:1272)"}
5. What I already tried:
I’ve put the Caddyfile info that’s in the docs ver batum (adjusting for my domain) and it doesn’t work.
I’ve added serve_server_wellknown: true
to my homeserver.yaml and it doesn’t work.
6. Links to relevant resources:
https://federationtester.matrix.org/#eschbach.house
https://federationtester.matrix.org/api/report?server_name=eschbach.house