From 1242f09a9600d0de2c3c269766f45982f3de891b Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Mon, 17 Sep 2018 00:42:16 +0200
Subject: [PATCH] ma euer.mon.krebsco.de: proxy to wbob

---
 2configs/nginx/euer.mon.nix | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/2configs/nginx/euer.mon.nix b/2configs/nginx/euer.mon.nix
index c5a7e68..765fef5 100644
--- a/2configs/nginx/euer.mon.nix
+++ b/2configs/nginx/euer.mon.nix
@@ -10,7 +10,12 @@ let
 in {
   services.nginx = {
     enable = mkDefault true;
-    virtualHosts."mon.euer.krebsco.de" = {
+    virtualHosts."mon.euer.krebsco.de" = let
+        # flesh_wrap
+        authFile = pkgs.writeText "influx.conf" ''
+            user:$apr1$ZG9oQCum$FhtIe/cl3jf8Sa4zq/BWd1
+          '';
+    in {
       forceSSL = true;
       enableACME = true;
       locations."/" =  {
@@ -21,6 +26,17 @@ in {
           proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
         '';
       };
+      locations."/influxdb/"  = {
+        proxyPass = "http://wbob.r:8086/";
+        extraConfig = ''
+            auth_basic       "Needs Autherization to visit";
+            auth_basic_user_file ${authFile};
+            proxy_http_version 1.1;
+            proxy_set_header Host $http_host;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_redirect off;
+        '';
+      };
     };
   };
 }