diff --git a/hosts/nixcloud/services.d/matrix.d/homeserver.nix b/hosts/nixcloud/services.d/matrix.d/homeserver.nix index 8079efe..f6882eb 100644 --- a/hosts/nixcloud/services.d/matrix.d/homeserver.nix +++ b/hosts/nixcloud/services.d/matrix.d/homeserver.nix @@ -17,4 +17,32 @@ }; }; }; + services.nginx.virtualHosts = { + "k3t.dev".locations."/.well-known/matrix/client" = { + return = '{"m.homeserver":{"base_url":"https://matrix.k3t.dev"},"m.identity_server":{"base_url":"https://vector.im"}}'; + extraConfig = '' + default_type application/json; + ''; + }; + "k3t.dev".locations."/.well-known/matrix/server" = { + return = '{"m.server": "matrix.k3t.dev:443"}'; + extraConfig = '' + default_type application/json; + ''; + }; + "matrix.k3t.dev" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:6167"; + proxyWebsockets = true; + extraConfig = + # required when the target is also TLS server with multiple hosts + "proxy_ssl_server_name on;" + + # required when the server wants to use HTTP Authentication + "proxy_pass_header Authorization;" + ; + }; + }; + }; } \ No newline at end of file