How exactly is your Matrix server running? Behind an nginx reverse proxy or are you using the cloudflare tunnel directly to it? Personally, I have mine behind a reverse proxy and just point the tunnel at my proxy.
Selfhosted
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:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
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.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
Since I just migrated to cf tunnels I set it up to directly point to my matrix instance. I was planning on implementing the rproxy back in once I got it working.
My old setup was way over convoluted with a double reverse proxy, ec2 instance, and vpn lmao.
So, my setup is this: Nginx reverse proxy using LE wildcard certs for my domain. I put my Matrix on a subdomain on my domain. Then I just point the CF tunnel to the reverse proxy using the subdomain for my public hostname. Everything works for me. Federation, local chat, etc. I have Home Assistant notifying me via Matrix now too.
To add more, I think you're right in suspecting your ./well-known setting. I'm not sure where you would set that in a direct to Matrix setup like you have but it's pretty easy using nginx. I just ran mine through the federation checker and my hosts section came back as exactly what I set in my location /.well-known/matrix/server directive in my nginx config.
I’ve recently done the same thing. I setup both dendrite and synapse.
For both I tried the srv record and could not get it to pass the federation testers. In the end as mines behind a nginx proxy I served the wellknows frommnginx rather than letting synapse/dendrite serve it. Federated correctly afterwards.
As such I would suggest serving the json well know using whatever reverse proxy you are using.
Hey, I recently accomplished this.
You have to host the .well-known via a reverse proxy and then point CT to the reverse proxy, like @[email protected] said. Personally, followed this guide and here they talk about how to serve the .well-known. You don't have to follow it exactly, if you already have a working Synapse server.
I hope I could help you and if you have any more questions feel free to ask.
Edit: formatting
Do it in stages. First get it running without any reverse proxies, just connecting directly to the exposed ports. Once that's working, add in your proxy. Then finally add cloudflare tunnels.