Open pscriptos opened 8 months ago
Your reverse proxy is likely not sending a Host
HTTP header or is sending an unexpected value.
The request seems to be reaching Traefik, but it responding with "404 not found" is an indication that you're either not specifying a Host
or you're specifying something that it doesn't recognize.
You can refeer to tour nginx example reverse-proxy configuration: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/7c1e5df3e79589c1288f2c5d0d8f406072866007/examples/reverse-proxies/nginx/matrix.conf#L18
Good evening,
Thank you very much for your feedback. So far I have limited myself to editing the two files. Do I have to carry out all other configurations directly on the matrix server or am I wrong? If so, where can I start? Because I have specified in the vars.yml
that I use my own reverse proxy and I have specified an IP address. Can I change the configurations on the matrix server directly without them being undone, for example, if I make further configurations on the Ansible side?
Thank you for your feedback and have a nice weekend, Patrick
Alll your modifications go to inventory/hosts
or inventory/matrix.DOMAIN/vars.yml
.
The matrix.conf
file I've linked to above is an example file that you can copy into your nginx configuration. You're not really using regular nginx though, so it doesn't really apply to you. That said, it can serve as inspiration.
I'd say there's nothing left for you to do on the Ansible side. Services should be configured correctly. You just need to fix your CloudPanel reverse-proxy server to send the appropriate Host
header when sending requests to the Traefik server.
Another question:
Shouldn't I also be able to call the Matrix Server internally? For example; http://10.0.1.110:8449
.
Here I get the same error message as shown above. if I call it internally, I do not go via the ReverseProxy but directly to the server. why do I get the same error message 404 page not found
?
Calling via the IP does not pass a Host
header, so it won't work.
If you modify your hosts
file (/etc/hosts
on UNIX, C:\Windows\something\something\hosts
on Windws) and hardcode matrix.DOMAIN
to go to 10.0.1.110
, you may be able to open http://matrix.DOMAIN:PORT
and reach it locally.
I have the same behaviour when I do it the way you just described:
I think there is something wrong with the configuration. I have certainly done something wrong, but what have I done wrong? :/
Having the same issue. Did you manage to fix it?
I am using nginx with the config similar to what @spantaleev linked above, but when I try to connect through that reverse proxy, I get 504 Gate Time-Out. When I try to use curl, I get 404. In my case, the matrix server and the NGINx are on separate machines in a VPN. I have added '10.10.0.1' (the IP of the reverse proxy) to devture_traefik_config_entrypoint_web_forwardedHeaders_trustedIPs, and NGINx routes its requests to 10.10.0.3 (the matrix server)
EDIT: I am able to get through with curl --header 'Host: matrix.domain.tld' http://10.10.0.3:8449/_matrix/federation/v1/version
, but it only works from the matrix server, not from the reverse proxy machine.
journalctl --since "now" -xfeu matrix-traefik.service
does not show any logs when making a request from the proxy machine.
EDIT2: My issue was caused by the (initial) lack of proxy_set_header Host $host;
in my NGINx config, and later by incorrect firewall settings (the ports were not open)
fixed for me by adding matrix_playbook_reverse_proxy_traefik_middleware_compression_enabled: false
Playbook Configuration:
My
vars.yml
file looks like this:Matrix Server:
Ansible: I am running Ansible on an LXC container. This LXC has only been created for Ansible. This means that nothing else is installed on the container. I also installed Matrix from here. Matrix was installed on a different server. Ansible Version: ansible [core 2.16.4]
Problem description:
I have installed Matrix via Ansible (IP:10.0.1.102) on the Matrix server (IP: 10.0.1.110). I decided to let Traefik do its work, but in such a way that I can use my ReverseProxy in the network. You can see this quite well in the vars.yml. The dockers all start and I can also see the status of the dockers, but when I call the matrix server, I get the message "404 page not found". It doesn't matter whether I try to call the service internally via HTTP/S or externally via my DNS record.
Special features: I have migrated my data. This means that I have migrated my Postgresql database and I have also migrated my media files. This worked well after some initial difficulties.
I also have a ProxyReverse server on the network. It is a CloudPanel. In terms of configuration, it is almost the same as an NGINX server. I guess that the ReverseProxy is not a problem here, because I also get the error when I try to call the service internally. Of course, I can't say for sure.
My installation is behind a firewall (OPNsense), behind which I currently still have an old, classic OnPrem installation of Matrix running. This runs on the same DNS. Of course, I switched off the "old" servers during and after the installation.
My hosts file looks like this:
I have discovered the following. Maybe this will help.
Client (please complete the following information):
I hope I have given you enough information. If there is anything else you would like me to provide, please let me know.
Thank you. Best regards, Patrick