1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 14:50:40 +02:00

feat: prepare local mirror web-proxy to speed up internal service access

This commit is contained in:
oddlama 2024-05-19 15:33:06 +02:00
parent 8148ce9f37
commit 3d12add14d
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
22 changed files with 139 additions and 3 deletions

View file

@ -9,6 +9,7 @@ in {
wireguard.proxy-sentinel = {
client.via = "sentinel";
firewallRuleForNode.sentinel.allowedTCPPorts = [config.services.grafana.settings.server.http_port];
firewallRuleForNode.ward-web-proxy.allowedTCPPorts = [config.services.grafana.settings.server.http_port];
};
age.secrets.grafana-secret-key = {
@ -78,6 +79,30 @@ in {
};
};
nodes.ward-web-proxy = {
services.nginx = {
upstreams.grafana = {
servers."${config.wireguard.proxy-sentinel.ipv4}:${toString config.services.grafana.settings.server.http_port}" = {};
extraConfig = ''
zone grafana 64k;
keepalive 2;
'';
};
virtualHosts.${grafanaDomain} = {
forceSSL = true;
useACMEWildcardHost = true;
locations."/" = {
proxyPass = "http://grafana";
proxyWebsockets = true;
};
extraConfig = ''
allow 192.168.1.0/24;
deny all;
'';
};
};
};
environment.persistence."/persist".directories = [
{
directory = config.services.grafana.dataDir;