Open bhyde opened 3 years ago
This is about examples/caddy/matrix-util
?
Does redir
have a higher priority than proxy /.well-known/acme-challenge http://127.0.0.1:2402
above it?
Is it a problem with this default config or if you do something else? What would be a better way to do things? Should we add some more examples to that config?
Does redir have a higher priority than proxy /.well-known/acme-challenge http://127.0.0.1:2402 above it? Exactly right. Though since Caddy prides it's self in handling let's encrypt for it's users it is vanishing rare that any of them ever configure an acme-challenge.
And, the route
directive is used to force the order/priority.
I made an example you maybe able to use. But first, I posted it in the caddy forum in hope of getting some code review.
The example config discussed here has been given an approving nod, and is working for me (finger's crossed).
I'm somewhat confused. Which file would you like to get these changes put into?
Perhaps you could submit a PR?
I'm pretty sure bhyde is referring to the instructions here: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md#configuring-service-discovery-via-well-known
The suggestion for Caddy 2 is:
For Caddy 2, it would be something like this:
reverse_proxy /.well-known/matrix/* https://matrix.DOMAIN { header_up Host {http.reverse_proxy.upstream.hostport} }
I've tried using this suggested configuration, but it results in the following error repeating infinitely and blocking my Caddy docker from starting:
{"level":"info","ts":1628424925.7943344,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
run: adapting config using caddyfile: /etc/caddy/Caddyfile:2: unrecognized directive: header_up
However, I also tried the instructions provided by @bhyde, but the federation tester is giving me the error:
Connection Errors
Unable to decode JSON from remote server: EOF
@QEDeD maybe take a look at https://caddy.community/t/unrecognized-directive-header-up/10319/13
The instructions for "configuring well known" are, like usual, concise. Possible too concise. At least for caddy2.
A note might be added: