April 15, 2026
Fixing "Image not loading" on Custom Domains in Next.js
A quick debugging guide to resolving next/image loader failures when deploying Next.js applications to custom domains.
const nextConfig = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 's3.amazonaws.com',
port: '',
pathname: '/your-bucket-name/**',
},
],
},
};
module.exports = nextConfig; ```
Once explicitly whitelisted, Next.js will safely optimize and serve the images across your custom domain.
module.exports = nextConfig; ```
Once explicitly whitelisted, Next.js will safely optimize and serve the images across your custom domain.