nixos-config/modules/system/services/server/nginx/virtualhosts/p2/default.nix

32 lines
880 B
Nix
Raw Normal View History

{ config, lib, ... }:
2024-10-22 21:08:23 -04:00
{
services.nginx.virtualHosts."${config.domains.p2}" = lib.mkIf config.system.server.enable {
2024-11-13 06:23:13 -05:00
enableACME = true;
addSSL = true;
root = "/var/www/landing-page";
2024-11-13 06:23:13 -05:00
locations = {
"/.well-known/matrix/client".extraConfig = ''
default_type application/json;
return 200 '
{
"m.homeserver": {
"base_url": "https://matrix.${config.domains.p2}"
2024-11-13 06:23:13 -05:00
},
"m.identity_server": {
"base_url": "https://matrix.org"
},
"org.matrix.msc3575.proxy": {
"url": "https://matrix.${config.domains.p2}"
2024-11-13 06:23:13 -05:00
}
}
2024-11-24 20:02:09 -05:00
';
2024-11-13 06:23:13 -05:00
'';
"/.well-known/matrix/server".extraConfig = ''
default_type application/json;
return 200 '{ "m.server": "matrix.${config.domains.p2}:443" }';
2024-11-13 06:23:13 -05:00
'';
2024-10-22 21:08:23 -04:00
};
};
}