nixos: services: matrix: simplify VHost

This commit is contained in:
Bruno BELANYI 2025-08-03 10:42:23 +02:00
parent f3964b07a0
commit 25106bee3c

View file

@ -134,29 +134,26 @@ in
}; };
}; };
}; };
# Dummy VHosts for port collision detection matrix = {
matrix-dummy = { # Somewhat unused, but necessary for port collision detection
inherit (cfg) port; inherit (cfg) port;
extraConfig = {
locations = {
# Or do a redirect instead of the 404, or whatever is appropriate
# for you. But do not put a Matrix Web client here! See the
# Element web section below.
"/".return = "404";
"/_matrix".proxyPass = "http://[::1]:${toString cfg.port}";
"/_synapse/client".proxyPass = "http://[::1]:${toString cfg.port}";
};
};
}; };
}; };
# Those are too complicated to use my wrapper... # Those are too complicated to use my wrapper...
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
${matrixDomain} = {
onlySSL = true;
useACMEHost = domain;
locations = {
# Or do a redirect instead of the 404, or whatever is appropriate
# for you. But do not put a Matrix Web client here! See the
# Element web section below.
"/".return = "404";
"/_matrix".proxyPass = "http://[::1]:${toString cfg.port}";
"/_synapse/client".proxyPass = "http://[::1]:${toString cfg.port}";
};
};
"${domain}" = { "${domain}" = {
forceSSL = true; forceSSL = true;
useACMEHost = domain; useACMEHost = domain;