From 80e3d7ff5681360689f3f858948bd9b477ae2f77 Mon Sep 17 00:00:00 2001 From: Catherine Date: Mon, 22 Sep 2025 16:26:55 +0000 Subject: [PATCH] Turn off Caddy's admin interface and expose metrics on the same port. --- conf/Caddyfile | 31 ++++++++++++++++++++----------- fly.toml | 1 - 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/conf/Caddyfile b/conf/Caddyfile index 255323e..a417846 100644 --- a/conf/Caddyfile +++ b/conf/Caddyfile @@ -9,6 +9,16 @@ } { + storage s3 { + host "{env.PAGES_STORAGE_S3_ENDPOINT}" + access_id "{env.PAGES_STORAGE_S3_ACCESS_KEY_ID}" + secret_key "{env.PAGES_STORAGE_S3_SECRET_ACCESS_KEY}" + bucket "{env.PAGES_STORAGE_S3_BUCKET}" + prefix "ssl" + } + + admin off + persist_config off log { @@ -20,17 +30,7 @@ } } - metrics { - per_host - } - - storage s3 { - host "{env.PAGES_STORAGE_S3_ENDPOINT}" - access_id "{env.PAGES_STORAGE_S3_ACCESS_KEY_ID}" - secret_key "{env.PAGES_STORAGE_S3_SECRET_ACCESS_KEY}" - bucket "{env.PAGES_STORAGE_S3_BUCKET}" - prefix "ssl" - } + metrics email {env.ACME_EMAIL} @@ -61,6 +61,11 @@ name health protocols h1 } + + servers :2019 { + name metrics + protocols h1 + } } (backend) { @@ -98,3 +103,7 @@ https:// { http://localhost:2002 { reverse_proxy http://localhost:3002 } + +http://:2019 { + metrics +} diff --git a/fly.toml b/fly.toml index 6345005..8129984 100644 --- a/fly.toml +++ b/fly.toml @@ -18,7 +18,6 @@ cpus = 2 memory = 512 [env] -CADDY_ADMIN = ":2019" UDP_BIND_TO = "fly-global-services" ALLOW_PROXY = "172.16.0.0/16" AUTOMEMLIMIT = "0.25"