Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
// next.config.js /** @type {import('next').NextConfig} */ const nextConfig = { // Enable React strict mode for catching bugs early reactStrictMode: true, // Allow next/image to load images from external domains images: { remotePatterns: [ { protocol: 'https', hostname: 'images.unsplash.com', }, { protocol: 'https', hostname: 'cdn.example.com', port: '', pathname: '/uploads/**', }, ], }, // Permanent redirects async redirects() { return [ { source: '/old-blog/:slug', destination: '/blog/:slug', permanent: true, // 308 status }, ]; }, // Rewrites (proxy without URL change) async rewrites() { return [ { source: '/api/v1/:path*', destination: 'https://external-api.com/:path*', }, ]; }, // Output mode for Docker deployment output: 'standalone', }; module.exports = nextConfig;
Result
Open