Skip to content

NextJS load external image Amazon

There is a specific url on amazon that stores some images on s3 that the amazon domain in question is already configured on the domain in next.config.js, but does not load on the front. If I put any external url, unsplah or other, it loads normally.

The url in question is:

And the error that occurs on the console is in the url with 404 (Bad Request)

— Error console —

GET http://localhost:3000/_next/image? 400 (Bad Request)

— next.config.js —

(module.exports = {
    images: {
      domains: [

— usage component —




So I searched for amazon s3 request and it seems you need to configure a few more things when sending the request. See the response codes for s3 bucket:

And see this blog for info on setting up Nextjs website with s3 bucket:

One thing that stood out from the blog: “One more thing we need to do is enable public access under the permissions tab. You can do this while uploading files as well.”

Edit: Try enable public access first (if the bucket can be public) and see if the request is successful then.

User contributions licensed under: CC BY-SA
1 People found this is helpful