I’m using Next.js 16.0.1 and loading images from a Directus /assets/<id> endpoint.
The Directus asset URL works fine in the browser: https://<directus-domain>/assets/<id>
But when Next.js tries to optimize it, the request fails: /_next/image?url=https://<directus-domain>/assets/<id>&w=1920&q=75
Directus returns: "url" parameter is not allowed
✔️ Working examples
<img src={`${DIRECTUS_URL}/assets/${id}`} />
<Image rc={`${DIRECTUS_URL}/assets/${id}`} alt="image" fill unoptimized />
❌ Not working (Next.js optimized image)
<Image rc={`${DIRECTUS_URL}/assets/${id}`} alt="image" fill />
My Next.js config
images: {
remotePatterns: [
{
protocol: "https",
hostname: "<directus-domain>",
pathname: "/assets/**",
},
],
}
Question
How can I configure Directus to allow requests like: /_next/image?url=https://<directus-domain>/assets/<id>
without rejecting them with "url" parameter is not allowed"?
Which Directus .env settings need to be update
d to permit this or anything else?