:80 {
	encode zstd gzip

	@hub path /hubs/*
	handle @hub {
		reverse_proxy backend-1:8080 backend-2:8080 {
			lb_policy cookie 0chat_hub_sticky change-this-caddy-lb-secret
			lb_try_duration 10s
			health_uri /health
			health_interval 5s
			health_timeout 2s
		}
	}

	@api path /api/*
	handle @api {
		reverse_proxy backend-1:8080 backend-2:8080 {
			lb_policy least_conn
			lb_try_duration 10s
			health_uri /health
			health_interval 5s
			health_timeout 2s
		}
	}

	handle {
		root * /srv/0chat
		try_files {path} /index.html
		file_server
	}
}
