Arno
(Arno)
May 7, 2025, 6:24am
1
1. The problem I’m having:
I am runnig a matrix chat server and i want it to use in with android, but then i got someting about .well-known. After searching a lot i found out that i have to put it in de caddy file.
But i have no idea what i have to put in there. I have seen a few examples but i have no idea how to use them in my case. I already have a lot of programs running.
So i have only the reverse proxy and below that i tried different sorts of scripts.
2. Error messages and/or full log output:
.well-known not available (in Element on Android)
3. Caddy version:
v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=
4. How I installed and ran Caddy:
I installed it in windows 11
a. System environment:
Ubuntu on WSL in windows 11
b. Command:
./caddy run
c. Service/unit/compose file:
d. My complete Caddy config:
}
mychat.website.org {
reverse_proxy localhost:8008
}
5. Links to relevant resources:
Mohammed90
(Mohammed Al Sahaf)
May 8, 2025, 11:07pm
2
Please share more details. Share the references you found where they talk about the .well-known
path and others. We aren’t experts in Matrix synapses.
Arno
(Arno)
May 10, 2025, 6:20am
3
Here are a few examples :
opened 03:19PM - 23 May 21 UTC
suggestion
docs
The instructions for "[configuring well known](https://github.com/spantaleev/mat… rix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md#option-3-setting-up-reverse-proxying-of-the-well-known-files-from-the-base-domains-server-to-the-matrix-server)" are, like usual, concise. Possible too concise. At least for caddy2.
A note might be added:
> Beware that caddy's `redir` directive has very high priority. For example you may need to us a `route` directive to work around that.
opened 03:49PM - 09 Aug 16 UTC
closed 04:15AM - 11 Aug 16 UTC
feature
#### 1. What version of Caddy are you running (`caddy -version`)?
Caddy 0.9.0
#… ### 2. What are you trying to do?
Create/verify Lets Encrypt certificates for non-HTTP services on a server that also happens to run Caddy.
#### 3. What is your entire Caddyfile?
``` text
http://*/.well-known {
root /stuff/.well-known
}
https://domain {
root /otherstuff
}
```
#### 4. How did you run Caddy (give the full command and describe the execution environment)?
`/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp -email=me@me.me`
#### 5. What did you expect to see?
``` text
certbot certonly --manual -d domain.com
printf '%s' "challenge" > /stuff/.well-known/acme-challenge/challenge
<cert is verified and added here>
```
#### 6. What did you see instead (give full error messages and/or log)?
From `certbot`:
``` text
Failed authorization procedure. domain.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://domain.com/.well-known/acme-challenge/challenge
2sU [123.456.789.10]: 500
```
From caddy:
``` text
http: proxy error: dial tcp [::1]:5033: getsockopt: connection refused
```
I see in the code that 5033 is the port used for a secondary verification server, so it looks like Caddy is hijacking all requests to that URI for its own purposes.
#### 7. How can someone who is starting from scratch reproduce this behavior as minimally as possible?
```
cat > Caddyfile <<EOF
http://*/.well-known {
root /stuff/.well-known
}
https://domain {
root /otherstuff
}
EOF
caddy
<new session here>
certbot certonly --webroot -w /stuff -d domain.com
```
opened 08:33AM - 10 Nov 20 UTC
closed 10:48AM - 16 Jun 22 UTC
Z-Help-Wanted
z-feature
T-Enhancement
P4
**Description:**
The response from the well-known endpoint is currently limit… ed to the homeserver and identity server base urls. Chat clients like Element require that some settings are served through this endpoint, which is quite hard to do the way it's currently set up. Would it be possible to add a "well-known" section to homeserver.yaml where you can add custom values?
Hi
Have a look at Nginx return directive in caddy -- return json - #3 by IndeedNotJames .
You technically don’t need the dougfredericks.space:8448 if you delegate via .well-known/matrix/server to { "m.server": "matrix.dougfredericks.space:443" }.
You would need to customize the handle_path from the linked post and add something like
dougfredericks.space {
handle_path /.well-known/matrix/* {
<all the other things>
}
}
to your Caddyfile and you should be all set!
Hope that helps, b…
If you can help me that would me great!