repos / ops

infra for pico services
git clone https://github.com/picosh/ops.git

ops / monitoring / caddy
Antonio Mika · 05 Oct 23

Caddyfile

 1{
 2	servers {
 3		metrics
 4	}
 5}
 6
 7*.{$APP_DOMAIN}, {$APP_DOMAIN} {
 8	@grafana {
 9		host grafana.{$APP_DOMAIN}
10	}
11
12	@prometheus {
13		host prometheus.{$APP_DOMAIN}
14	}
15
16	tls {$APP_EMAIL} {
17		dns cloudflare {$CF_API_TOKEN}
18		resolvers 1.1.1.1
19	}
20
21	encode zstd gzip
22
23	reverse_proxy @grafana grafana:3000
24
25	basicauth @prometheus {
26		eric JDJhJDE0JDdPOXhoNUdhSmNVNDl6UWpmeTE0cWVkLjRwcUNJUnc0dVQ4MTZNSmVaNjA1TlptaVZYY1hh
27		antonio JDJhJDE0JHI5dkVtMW0vcGxIb011OG4vME5HOU91c3U2VjM2QTZiWVpUeXdSbEg3VUtNZVdhN3BRazFH
28		bot JDJhJDE0JFVsRlNHSDlJbFhDeUd0NldRR2JkcGVFYUJtWGluTHZDVlc5L3QwNWNwWUMuODRlcXZNZHpT
29	}
30	reverse_proxy @prometheus prometheus:9090
31
32	@caddymetrics {
33		host monitoring.{$APP_DOMAIN}
34		path /_caddy/metrics
35	}
36
37	metrics @caddymetrics {
38		disable_openmetrics
39	}
40}