diff bin/homepageConfig @ 2034:04ed5d134973

WIP draw prom metrics on homepage
author drewp@bigasterisk.com
date Sat, 09 Apr 2022 02:47:45 -0700
parents ec6ec713c276
children bfee787d7b5c
line wrap: on
line diff
--- a/bin/homepageConfig	Sat Apr 09 01:40:29 2022 -0700
+++ b/bin/homepageConfig	Sat Apr 09 02:47:45 2022 -0700
@@ -38,8 +38,21 @@
     if not path:
         continue
     server = server.rstrip('/')
+    if 'collector' in path: continue
     location(path, server)
 
+print('''
+
+  location /collector/metrics {
+    rewrite "/collector(/.*)" "$1" break;
+    proxy_pass http://localhost:8202;
+  }
+  location /collector/ {
+    proxy_pass http://localhost:8302;
+  }
+
+''')
+
 showPath = showconfig.showUri().split('/', 3)[-1]
 root = showconfig.root()[:-len(showPath)].decode('ascii')
 print(f"""