how to show next/image in domain ip public

171 Views Asked by At

Hello i have issue to get src url image with next/image, i already setup in next.config.js but still error. here my code

index.js

<Image src={'http://110.100.190.222:9790/images/'+item.article_image_path} alt="logo" width={300} height={100} />

next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  optimizeFonts: true,
  images: {
    remotePatterns: [
      {
        protocol: 'http',
        hostname: '110.100.190.222:9790',
      },
    ],
    minimumCacheTTL: 1500000,
  },
}

module.exports = nextConfig

here still error enter image description here

i try using this host https://freeimage.host/i/HIV7RRI works smooth, but with domain like that still error. that domain ip public is not my real domain ip public.

1

There are 1 best solutions below

1
On

i found way but force,

const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  optimizeFonts: true,
  images: {
    remotePatterns: [
      {
        protocol: 'http',
        hostname: '**',
      },
    ],
    minimumCacheTTL: 1500000,
  },
}

module.exports = nextConfig