Hey everyone,

Has anyone been able to get matrix federation working with Caddy using CloudFlare SSL and proxy?

Here is my caddy file settings, the server works great but I failed the federation tester as it says there is no well-known located.

example.com {

        tls {
                dns cloudflare "api_token"
        }

        header /.well-known/matrix/* Content-Type application/json
        header /.well-known/matrix/* Access-Control-Allow-Origin *
        respond /.well-known/matrix/server `{"m.server": "matrix.example.com:443"}`
        respond /.well-known/matrix/client `{"m.homeserver":{"base_url":"https://matrix.example.com"},"m.ide
ntity_server":{"base_url":"https://identity.example.com"}}`
}

*.example.com {

        tls {
                dns cloudflare "api_token"
        }

        @matrix host matrix.example.com
        handle @matrix {
                reverse_proxy /_matrix/* 10.10.10.10:8008
                reverse_proxy /_synapse/client/* 10.10.10.10:8008
        }

        @element host element.example.com
        handle @element {
                reverse_proxy 10.10.10.10:8075
        }

Any help would be greatly appreciated

@seang96@spgrn.com
link
fedilink
English
11Y

I set mine up q couple months ago, but I remember having to configure caddy with the files under .well-known. Are you hosting any files under it? Are those files valid for the matrix setup?

Probably the federation is still trying to access matrix.example.com instead of just example.com to get the .well-known configuration.
I’m not sure how to make this work in general, you need a way for the federated instances to ask your instance for the configuration in the host you want.

Create a post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

  • 1 user online
  • 127 users / day
  • 422 users / week
  • 1.16K users / month
  • 3.85K users / 6 months
  • 1 subscriber
  • 3.68K Posts
  • 74.2K Comments
  • Modlog