# Generated by `obskitpy cloud azure up`. Caddy obtains and renews the HTTPS certificate by itself.
{$DOMAIN} {
	encode zstd gzip

	# Telemetry from robots (OTLP over HTTP): only with the ingest token, never open to the internet.
	handle /v1/* {
		@ingest header X-Obskitpy-Ingest {$INGEST_TOKEN}
		handle @ingest {
			reverse_proxy otel-collector:4318
		}
		respond "unauthorized" 401
	}

	# The console reads Elasticsearch through /es/: only for a signed-in portal user.
	handle /es/* {
		forward_auth portal:8000 {
			uri /api/v1/auth/me
		}
		reverse_proxy dash:80
	}

	handle {
		reverse_proxy dash:80
	}
}
