nixos-config/modules/system/services/server/webserver/nginx/virtualhosts/nixfox/default.nix
2025-03-04 17:24:48 -05:00

29 lines
838 B
Nix

{ config, lib, ... }:
{
services.nginx.virtualHosts = lib.mkIf config.system.server.enable {
"www.nixfox.ca" = {
enableACME = true;
addSSL = true;
default = true;
root = "/var/www/landing-page";
};
"nixfox.ca" = {
enableACME = true;
addSSL = true;
globalRedirect = "www.nixfox.ca";
locations = {
"/.well-known/matrix/client".extraConfig = ''
default_type application/json;
return 200 '{
"m.homeserver": { "base_url": "https://matrix.nixfox.ca" },
"m.identity_server": { "base_url": "https://matrix.org" }
}';
'';
"/.well-known/matrix/server".extraConfig = ''
default_type application/json;
return 200 '{ "m.server": "matrix.nixfox.ca:443" }';
'';
};
};
};
}