From 4a6d5548c50137f1f1e8c8b67bea2d851eae7f69 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Tue, 15 Nov 2016 21:09:26 +0100 Subject: Expose grafana too --- extras/misc/varnish.vcl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'extras/misc/varnish.vcl') diff --git a/extras/misc/varnish.vcl b/extras/misc/varnish.vcl index dd71a31..4920963 100644 --- a/extras/misc/varnish.vcl +++ b/extras/misc/varnish.vcl @@ -17,6 +17,11 @@ backend templating { .port = "8080"; } +backend grafana { + .host = "gondul-grafana"; + .port = "3000"; +} + sub vcl_recv { if (req.url ~ "^/where" || req.url ~ "^/location") { set req.url = "/api/public/location"; @@ -32,10 +37,15 @@ sub vcl_recv { return (synth(418,"LOLOLOL")); } - if (req.url ~ "/render") { + if (req.url ~ "^/render") { set req.backend_hint = graphite; } - if (req.url ~ "/api/templates") { + if (req.url ~ "^/grafana") { + set req.url = regsub(req.url, "^/grafana",""); + set req.backend_hint = grafana; + return (pass); + } + if (req.url ~ "^/api/templates") { set req.url = regsub(req.url, "/api/templates", ""); set req.backend_hint = templating; } -- cgit v1.2.3