{
  crowdsec {
      api_url {$CROWDSEC_API_URL}
      api_key {$CROWDSEC_API_KEY}
  }
}

{$CADDY_BASE_HOST} {
  @blocked not remote_ip {$CADDY_ALLOWED_IPS}
  route {
    crowdsec
    respond @blocked "<h1>Access Denied</h1>" 403
  }
  encode zstd gzip
  reverse_proxy http://frontend:3000
  handle_path /api/* {
    reverse_proxy http://backend:3000
  }
  handle_path /profileImages/* {
    rewrite * /sorvor{path}
    reverse_proxy http://minio:9000

  }
  log {
    output file /var/log/caddy/access.log
  }
}
