about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2023-07-07 20:14:56 +0200
committerAlan Pearce2023-07-07 20:14:56 +0200
commit3dcd97ff77e9f9f5e3ea2b97b9e15c7c1066859d (patch)
treebbba5a975efc64d7bf069c17850202eb91b1565c
parent2d635ac0e7045663e22df1d4183ae4348f01d527 (diff)
downloadwebsite-3dcd97ff77e9f9f5e3ea2b97b9e15c7c1066859d.tar.lz
website-3dcd97ff77e9f9f5e3ea2b97b9e15c7c1066859d.tar.zst
website-3dcd97ff77e9f9f5e3ea2b97b9e15c7c1066859d.zip
Replace metrics with advanced metrics for path-based counters
-rw-r--r--Caddyfile10
-rw-r--r--Dockerfile3
2 files changed, 7 insertions, 6 deletions
diff --git a/Caddyfile b/Caddyfile
index e5ca8f7..7c7e0b4 100644
--- a/Caddyfile
+++ b/Caddyfile
@@ -4,17 +4,14 @@
 	auto_https disable_redirects
 	acme_ca https://acme.zerossl.com/v2/DV90
 	import globals/*
+	order advanced_metrics before file_server
+	order advanced_metrics before reverse_proxy
 	servers :80 {
-		metrics
 		protocols h1 h2c
 		trusted_proxies static private_ranges
 	}
 }
 
-:9091 {
-	metrics
-}
-
 http://,
 http://alanpearce.uk,
 http://www.alanpearce.uk,
@@ -24,6 +21,9 @@ http://www.alanpearce.eu {
 }
 
 http://alanpearce.eu {
+	advanced_metrics {
+		port 9091
+	}
 	root * {$SITE_ROOT}
 	file_server {
 		precompressed br zstd gzip
diff --git a/Dockerfile b/Dockerfile
index 72dc719..512d6c2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,7 +4,8 @@ ARG VARIANT=alpine
 FROM docker.io/caddy:${VERSION}-builder-${VARIANT} AS builder
 
 RUN xcaddy build \
-    --with github.com/gamalan/caddy-tlsredis
+    --with github.com/gamalan/caddy-tlsredis \
+    --with github.com/sebastianbrunnert/caddy-advanced-metrics
 
 FROM docker.io/caddy:${VERSION}-${VARIANT}