
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGood news! Custom domain names for Sanity's CDN (cdn.sanity.io) are available, but they require an Enterprise plan. If you're on a different plan tier, you'll need to implement a workaround using a reverse proxy.
On the Enterprise plan, Sanity can configure a custom domain for your asset CDN. This is the cleanest solution as it's handled at the platform level, and all your asset URLs will automatically use your custom domain.
If you're not on an Enterprise plan, you can achieve custom domain URLs using a redirect/reverse proxy approach:
The @sanity/image-url library supports a spec.baseUrl parameter that lets you specify a custom base URL for your images. You'd set up a reverse proxy on your domain that forwards requests to cdn.sanity.io.
Here's a practical solution that works particularly well with hosting platforms like Netlify:
const fileName = url.substring(url.lastIndexOf('/') + 1)`https://your-domain.com/files/${fileName}`/files/* → https://cdn.sanity.io/files/[your-project-id]/[your-dataset-name]/:splat
This approach works for any asset type and doesn't require changes to how you query assets from Sanity. The GraphQL/GROQ queries will still return the standard cdn.sanity.io URLs, but you transform them client-side before rendering.
The redirect happens server-side, so your users see your custom domain while the actual assets are still served from Sanity's globally distributed CDN, maintaining performance and reliability. This is a common pattern that many Sanity users have successfully implemented, as discussed in this community thread.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store