32 lines
880 B
Nix
32 lines
880 B
Nix
{ config, lib, ... }:
|
|
{
|
|
services.nginx.virtualHosts."${config.domains.p2}" = lib.mkIf config.system.server.enable {
|
|
enableACME = true;
|
|
addSSL = true;
|
|
root = "/var/www/landing-page";
|
|
locations = {
|
|
"/.well-known/matrix/client".extraConfig = ''
|
|
default_type application/json;
|
|
return 200 '
|
|
{
|
|
"m.homeserver": {
|
|
"base_url": "https://matrix.${config.domains.p2}"
|
|
},
|
|
"m.identity_server": {
|
|
"base_url": "https://matrix.org"
|
|
},
|
|
"org.matrix.msc3575.proxy": {
|
|
"url": "https://matrix.${config.domains.p2}"
|
|
}
|
|
}
|
|
';
|
|
'';
|
|
|
|
"/.well-known/matrix/server".extraConfig = ''
|
|
default_type application/json;
|
|
return 200 '{ "m.server": "matrix.${config.domains.p2}:443" }';
|
|
'';
|
|
};
|
|
};
|
|
}
|