Skip to content

Custom CDN

By default, all files are served from https://cdn.atiru.io. You can configure your own CDN domain so file URLs use your brand (e.g. https://cdn.example.com/m/abc123).

How it works

  1. You set a public URL base (e.g. https://cdn.example.com) in Settings.
  2. Your DNS must point that domain to Atiru's CDN via a CNAME record.
  3. Atiru serves /m/ and /d/ requests when they arrive at your domain.

The URL base must not include /m/ or /d/—Atiru appends the path. Use the origin only: https://cdn.example.com.

Dashboard: Configure

  1. Log in to atiru.io.
  2. Go to Settings.
  3. In Custom CDN URL, enter your base URL (e.g. https://cdn.example.com).
  4. Save.

After saving, new uploads will return public_url and public_download_url using your domain.

API: Configure

Endpoint: PATCH /settings

json
{
  "public_url_base": "https://cdn.example.com"
}

curl

bash
curl -X PATCH "https://api.atiru.io/settings" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"public_url_base":"https://cdn.example.com"}'

DNS setup: CNAME to cdn.atiru.io

Your custom domain must resolve to Atiru's CDN. Create a CNAME record:

TypeNameTargetProxy
CNAMEcdn (or @)cdn.atiru.ioEnabled (recommended)

The exact record depends on your DNS provider. Below is an example with Cloudflare.

Cloudflare example

  1. Log in to Cloudflare.
  2. Select your domain (e.g. example.com).
  3. Go to DNSRecords.
  4. Click Add record.
  5. Configure:
    • Type: CNAME
    • Name: cdn (for cdn.example.com) or @ (for root example.com)
    • Target: cdn.atiru.io
    • Proxy status: Proxied (orange cloud) — recommended for caching and DDoS protection
  6. Save.

After DNS propagates (usually minutes), requests to https://cdn.example.com/m/abc123 will be routed to Atiru and served correctly.

Important

  • HTTPS: Use https:// in your public URL base. Your CDN provider (e.g. Cloudflare) will handle TLS.
  • No trailing slash: Use https://cdn.example.com, not https://cdn.example.com/.
  • Proxy enabled: If using Cloudflare, keep the proxy (orange cloud) enabled so traffic goes through Cloudflare's CDN before reaching Atiru.
  • Allowed domains: Some deployments may restrict which domains can be used. If your domain is rejected, contact support.