{
	admin off
	auto_https off
	log {
		level ERROR
	}
}

http://:80 {
	encode zstd gzip

	@backend path /api* /auth* /health*
	handle @backend {
		reverse_proxy api-1:8080 api-2:8080 {
			lb_policy round_robin
			lb_try_duration 5s
			lb_try_interval 250ms
			lb_retry_match {
				method GET POST PUT PATCH DELETE
			}
			fail_duration 30s
			max_fails 1
			health_uri /healthz
			health_interval 2s
			health_timeout 1s
		}
	}

	handle {
		root * /usr/share/caddy
		try_files {path} /index.html
		file_server
	}
}
