summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/grafana.nix
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/2configs/shack/grafana.nix')
-rw-r--r--krebs/2configs/shack/grafana.nix18
1 files changed, 14 insertions, 4 deletions
diff --git a/krebs/2configs/shack/grafana.nix b/krebs/2configs/shack/grafana.nix
index adf0a4bc..78ef29f9 100644
--- a/krebs/2configs/shack/grafana.nix
+++ b/krebs/2configs/shack/grafana.nix
@@ -1,10 +1,20 @@
-let
+{ config, ... }: let
port = 3000;
in {
-
networking.firewall.allowedTCPPorts = [ port ]; # legacy
services.nginx.virtualHosts."grafana.shack" = {
- locations."/".proxyPass = "http://localhost:${toString port}";
+ locations."/" = {
+ proxyPass = "http://localhost:${toString port}";
+ extraConfig =''
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+ '';
+
+ };
};
services.grafana = {
enable = true;
@@ -14,6 +24,6 @@ in {
users.allowOrgCreate = true;
users.autoAssignOrg = true;
auth.anonymous.enable = true;
- security = import <secrets/grafana_security.nix>;
+ security = import "${config.krebs.secret.directory}/grafana_security.nix";
};
}