Next.js Discord

Discord Forum

upstream image response failed for 403 nextjs

Unanswered
Entlebucher Mountain Dog posted this in #help-forum
Open in Discord
Avatar
Entlebucher Mountain DogOP
Image

6 Replies

Avatar
Crazy ant
Did you add your image domain in to next.config.js file.
Avatar
Entlebucher Mountain DogOP
yes i did
by default it will accept all domains url
Avatar
Crazy ant
could you send snapshot of next.config.js. only that part where image domian is added.
nextjs does not accept all domain url by default
Avatar
Entlebucher Mountain DogOP
/ @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "http",
hostname: "
",
},
{
protocol: "https",
hostname: "**",
},
],
},
output: "standalone",
};

module.exports = nextConfig;
Avatar
Crazy ant
For external images you should consider proxy like cloudinary.com etc. better to mention specific hostname and protocol as https. are you fetching images from an external source? Your configuration should also work, just remove the object with http and keep https one if you are fetching images from an external source.