Hacker News new | past | comments | ask | show | jobs | submit login

Is there a way to run a homeserver on mydomain.com but also serve a website from that?



Yes.

Matrix uses SRV records and .well-known for discovering the homeserver for a domain.

https://matrix.org/docs/spec/server_server/latest#resolving-...


Yes, this is what I do. You just set a DNS record on a subdomain, e.g. matrix.mydomain.com, and use that as your home server. Your username can still be @me:mydomain.com with this setup.


This is a good question, as historically different protocols used different ports to communicate, meaning you could have many services on the same domain/IP, but recently many new protocols run over HTTP port 443... And I think Matrix is one of them, so the answer is no, you cannot host both a website and a matrix server on the same domain name. Happy to be corrected if I'm wrong.


Actually, it uses port 8448 for federation [0], which is unlikely to conflict with other services. But, even if it does, there are ways to specify a different port or subdomain [1].

[0] https://matrix-org.github.io/synapse/latest/federate.html

[1] https://matrix-org.github.io/synapse/latest/delegate.html


No, you can have both. All you need to do is proxy a few paths to the running instance of Matrix. Those paths are matrix-specific and won't interfere with anything else. I've been running on this configuration for some time now.

More details here: https://matrix-org.github.io/synapse/latest/reverse_proxy.ht...


You don't even need to do that.

Either add an DNS SRV record to example.com pointing matrix to matrix.example.com, or server a single JSON under .well-known pointing matrix to matrix.example.com.

https://matrix.org/docs/spec/server_server/latest#resolving-...


Ah, that is much better.

In my instance, my root domain is served from CloudFront, so in this instance I could add an A record to a homeserver VPS and use a SRV/.well-known to point to it :)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: