matrix-docker-ansible-deploy
matrix-docker-ansible-deploy copied to clipboard
Cant access https://matrix.<my-domain> from local network
Although my server can be accessed from [email protected] client and from Element desktop app and from Tor browser,I cant access it locally via a browser-I get connection refused from element.Also when self-checking it always fails the Client-API check with connection refused.Strangely enough https://matrix.
This is an issue with your firewall, not the Playbook
I have no firewall rules preventing access. It must be some iptables issue INSIDE the Debian vm where Synapse was installed by ansible. Also inside the VM there is no ufw no firewalld no iptables config except the one put there by ansible. Strange... Very strange.....
Futhermore I checked if Letsencrypt certs are ok with
openssl s_client -showcerts -connect matrix.mtx.gleeze.com:443
and everything returned ok.
Now something interesting happened.
I can to access the server by ip both http and https BUT not by DOMAIN from local network(where as from external network accessing by https://matrix.
It's an issue on your NAT gateway. It's routing packets arriving on the HTTPS port from the external network towards the proxy, but it is not routing them from the internal network
in this case, it can help to search how to enable "nat reflection" on your router.
Another simple fix would be to write a static entry to your /etc/hosts file on your client PC. On Windows it is located at C:\Windows\System32\drivers\etc\hosts
For example, if your matrix server is matrix.DOMAIN.tld and has a LAN IP of 192.168.1.100
192.168.1.100 matrix.DOMAIN.tld
It is simple but you would need to disable this rule (comment the line with #) every time you would try to connect to matrix from outside your home network.
Another cool solution would be to install a local DNS server, such as pi-hole, add an A record to your LAN matrix server's IP and setup your DHCP server (probably your router) to propagate your new local DNS instance as the default DNS server in your home network.
But I guess @jsddsfoh's NAT reflection solution is simpler, so try this one first.
This issue is more than a year old, have you found a solution since then?