2024-01-27 10:19:30 +00:00
|
|
|
{ config, flake, lib, ... }:
|
|
|
|
let
|
|
|
|
# Get port from first element in list of matrix-synapse listeners
|
|
|
|
synapsePort = "${toString (lib.findFirst (listener: listener.port != null) "" config.services.matrix-synapse.settings.listeners).port}";
|
|
|
|
in
|
2023-12-06 18:11:45 +00:00
|
|
|
{
|
2023-12-06 18:51:27 +00:00
|
|
|
age.secrets.nachtigall-metrics-nginx-basic-auth = {
|
|
|
|
file = "${flake.self}/secrets/nachtigall-metrics-nginx-basic-auth.age";
|
2023-12-06 18:11:45 +00:00
|
|
|
mode = "600";
|
|
|
|
owner = "nginx";
|
|
|
|
};
|
|
|
|
services.nginx.virtualHosts = {
|
|
|
|
"nachtigall.pub.solar" = {
|
|
|
|
enableACME = true;
|
|
|
|
addSSL = true;
|
|
|
|
basicAuthFile = "${config.age.secrets.nachtigall-metrics-nginx-basic-auth.path}";
|
|
|
|
locations."/metrics" = {
|
|
|
|
proxyPass = "http://127.0.0.1:${toString(config.services.prometheus.exporters.node.port)}";
|
|
|
|
};
|
2024-01-25 19:21:50 +00:00
|
|
|
locations."/_synapse/metrics" = {
|
2024-01-27 10:19:30 +00:00
|
|
|
proxyPass = "http://127.0.0.1:${synapsePort}";
|
2024-01-25 19:21:50 +00:00
|
|
|
};
|
2023-12-06 18:11:45 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|