-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 when accessing example.com/.well-known/matrix/* #3963
Comments
Traefik does not serve the base domain for you by default. There's a separate |
That was it. Took some searching, but if anyone else finds their way here it's here: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-base-domain-serving.md#serving-a-more-complicated-website-at-the-base-domain Needed to add these two lines to my vars.yml:
@spantaleev I would suggest adding a section to https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md#option-2-setting-up-reverse-proxying-of-the-well-known-files-from-the-base-domains-server-to-the-matrix-server about this. Following the logical flow of this page, nothing suggested to me that I needed to look at the documentation for serving the base domain. The only reference to that page is this: "If you decide to go this route, you don't need to read ahead in this document. Instead, go to Serving the base domain...", which seems to say that these two pages are mutually exclusive. But actually, for (all?) redirection to work per the suggested option 2, you need to setup the base domain serving as well. |
What should have told you about the base domain is the Finalize the installation section on The base domain is only involved in getting your server to federate successfully. You can use your server even without doing this extra setup. Of course, most people would like to do it, but it's just.. the next step after the initial setup. Actually, there are 2 ways to handle the base domain for people like you who are fronting Traefik with their own reverse-proxy:
The docs that you're linking to ((Option 2): Setting up reverse-proxying of the well-known files from the base domain's server to the Matrix server) tell you how to do the latter. Doing that, you don't need to make Traefik handle the base domain. It's only your external/other reverse-proxy that handles the base domain, and forwards Serving the base domain from the Matrix server is mostly useful for people who don't front Traefik with another reverse-proxy and who mostly don't need to host a website at the base domain. If that's not you, perhaps it's not the best option for you. You may be right that we need to update some docs to make this more clear (though yours is quite a special case), but I'm not sure which and how. |
I must've missed that part in the "Finalize the installation"-step, since it's after the link. In my mind that puts that as something I should do after completing everything in the link. But, clearly it was in the docs so perhaps it's not such a big issue, I just missed it when I was searching for it. I didn't think my case was quite so special, but perhaps it's more rare than I thought. If so, perhaps this is fine. I would suggest just changing the order such that this line: |
Playbook Configuration:
My
vars.yml
file looks like this:Matrix Server:
Ansible:
N/A
Problem description:
It appears that nginx is removing the /client from the end of the query, and I'm not really sure why. Details:Update: I added a custom location in nginx specifically for /.well-known/matrix/client and I'm still getting the same error. Traefik outputs the following:
https://<mydomain>.com/.well-known/matrix/client
https://matrix.<mydomain>.com/.well-known/matrix/client
As I use nginx on my primary domain already (example.com), I followed this guide to set up my reverse proxy: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md#option-2-setting-up-reverse-proxying-of-the-well-known-files-from-the-base-domains-server-to-the-matrix-server
However, when accessing https://.com/.well-known/matrix/client I'm getting a 404 instead of a json. Accessing https://matrix..com/.well-known/matrix/client does provide the expected JSON.
Using
journalctl -fu matrix-traefik.service
I can see that the request reaches traefik in both cases, but it doesn't seem to behave quite the same. This is the output when I access .com/.../clientAnd similarly, this is the output when I access matrix..com/.../client
Additional context
Here's my nginx config (some boilerplate due to using Nginx Proxy Manager), but mostly I've just tried to match it to the example in the docs from the link above:
The text was updated successfully, but these errors were encountered: