Skip to main content

How to display images from all domains in Next.js

ยท One min read
Joodi
Published in Linkedin

To allow Next.js to display images from all domains, modify your "next.config.js" file to add an object with protocol and hostname properties to the "remotePatterns" array property.

tip

Use ** in next.config.mjs

/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
},
],
}
};

export default nextConfig;