Skip to content
Discussion options

You must be logged in to vote

The image’s origin domain isn’t allow-listed (or the origin blocks hotlinking). Add the host to images.domains (simple) or use images.remotePatterns (granular). If the origin blocks Vercel’s optimizer, proxy the image through your app.

✅ Allow-list the image host

next.config.js (simple host allow-list)

// next.config.js
module.exports = {
images: {
domains: [
"images.unsplash.com",
"cdn.example.com",
"lh3.googleusercontent.com",
],
},
};

next.config.js (granular patterns)

// next.config.js
module.exports = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "images.unsplash.com",
pathname: "/photo-",
},
{
protocol: "https",
hostname: "cdn.example.com",
pathname: "/products/
",
},
{

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@icyJoseph
Comment options

Answer selected by yourfavvgamifyyy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants