nix-infra/hosts/metrics/nginx.nix

28 lines
651 B
Nix
Raw Normal View History

2023-08-06 17:53:50 +02:00
{ config, ... }:
{
services.nginx = {
enable = true;
virtualHosts = {
${config.services.grafana.settings.server.domain} = {
2023-08-06 17:53:50 +02:00
forceSSL = true;
enableACME = true;
listen = [
{
addr = "0.0.0.0";
port = 80;
}
{
addr = "0.0.0.0";
port = 443;
ssl = true;
}
];
locations."/" = {
proxyPass = "http://${config.services.grafana.settings.server.http_addr}:${builtins.toString config.services.grafana.settings.server.http_port}";
proxyWebsockets = true;
2023-08-06 17:53:50 +02:00
};
};
};
};
}