import type { NextConfig } from "next"; const nextConfig: NextConfig = { images: { unoptimized: true, remotePatterns: [ { protocol: 'https', hostname: '**', }, { protocol: 'http', hostname: '**', }, ], }, async rewrites() { // Only proxy /api in development; in production nginx handles it if (process.env.NODE_ENV === 'development') { return [ { source: '/api/:path*', destination: 'http://localhost:4001/api/:path*', }, ]; } return []; }, }; export default nextConfig;