Checks while you click
Every toggle is checked against the others as you go. A static export with rewrites, a wildcard CORS origin with credentials, an open image host: each shows up with a clear label and a button that jumps to the option involved.
Pick what your deployment needs. The file writes itself.
reactStrictModeDouble-invoke render and effects in development to surface unsafe code.
Recommended
outputPackage the build as a standalone server or as a fully static export.
distDirRename the folder the build is written to.
basePathServe the whole app under a sub-path such as /docs.
assetPrefixServe static assets from a CDN origin instead of your app domain.
trailingSlashForce every URL to end with a slash.
pageExtensionsRestrict or extend which file extensions become routes.
envInline values into the bundle at build time.
serverExternalPackagesv15.0Keep specific server packages out of the bundler.
transpilePackagesCompile untranspiled dependencies from your monorepo or npm.
outputFileTracingRootPoint tracing at the monorepo root so shared files are included.
cleanDistDirWipe the build folder before each build.
images.remotePatternsWhitelist the hosts next/image is allowed to optimize from.
images.domainsdeprecatedThe old hostname whitelist, kept for migrations only.
images.formatsModern formats the optimizer may serve.
images.deviceSizesWidths generated for images that fill the viewport.
images.imageSizesWidths generated for images with a known display size.
images.qualitiesv16.0Restrict which `quality` values callers may request.
images.minimumCacheTTLFloor for how long an optimized image is cached, in seconds.
images.unoptimizedServe every image exactly as authored.
images.dangerouslyAllowSVGPermit SVG files through the image optimizer.
images.contentDispositionTypeHow the browser is told to handle optimized image responses.
images.loaderHand URL building to an external image service.
images.loaderFileModule that exports the custom loader function.
headersSend hardening headers on every route.
headersWhich routes the cross-origin rules apply to.
headersOrigins permitted to call your API from a browser.
headersHTTP methods accepted from other origins.
headersCustom headers other origins may send.
headersLet cross-origin requests carry cookies.
headersSend X-Robots-Tag to keep an environment out of search results.
headersLong-lived cache rules for your own asset folders.
poweredByHeaderStop advertising the framework in every response.
compressHand gzip and brotli to nginx or the CDN instead.
crossOriginAttribute added to script tags Next.js injects.
httpAgentOptions.keepAliveTurn off connection reuse for server-side fetches.
redirectsSend one path to another with a real HTTP status.
rewritesProxy a path to another destination without changing the URL.
skipTrailingSlashRedirectStop Next.js redirecting between slashed and unslashed URLs.
skipMiddlewareUrlNormalizeGive middleware the raw, unnormalized URL.
compiler.removeConsoleRemove console output from production builds.
compiler.reactRemovePropertiesDrop data-testid props from production output.
compiler.styledComponentsEnable the SWC transform for styled-components.
experimental.optimizePackageImportsTree-shake barrel-file packages like icon libraries.
experimental.optimizeCssInline above-the-fold CSS and defer the rest.
experimental.reactCompilerv15.0Let the compiler insert memoization for you.
experimental.pprServe a static shell and stream the dynamic parts in.
experimental.serverActions.bodySizeLimitMaximum payload a server action will accept.
staticPageGenerationTimeoutSeconds a single page may take to prerender.
expireTimeSeconds a CDN may serve stale ISR content while revalidating.
cacheHandlerShare the ISR cache across instances with Redis.
cacheMaxMemorySizeBytes of ISR cache kept in process memory. Zero disables it.
experimental.webpackMemoryOptimizationsTrade some build speed for lower peak memory.
turbopack.rootTell Turbopack where the workspace root is.
typescript.ignoreBuildErrorsLet the build finish even with type errors.
eslint.ignoreDuringBuildsDo not run linting as part of next build.
eslint.dirsLimit which folders are linted during the build.
productionBrowserSourceMapsShip browser source maps with the production build.
logging.fetches.fullUrlPrint complete URLs for server-side fetches in development.
next.config.ts// Generated with the UntangleTools Next.js config generator.// File: next.config.tsimport type { NextConfig } from "next";const nextConfig: NextConfig = { reactStrictMode: true,};export default nextConfig;Next.js config generator
This Next.js config generator writes your next.config.ts or next.config.js while you click. Start from a preset for Vercel, Docker, Kubernetes, nginx or a static export, switch on only the settings your project needs, and the finished file builds itself beside the options. Each option says when to use it and when to leave it off, and an Issues tab flags combinations that fail, such as rewrites inside a static export or an image host left wide open. It is for developers who ship Next.js apps and would rather not copy a config from an old repo and hope it still fits.
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
reactStrictMode: true,
output: "standalone",
images: {
remotePatterns: [
{
protocol: "https",
hostname: "res.cloudinary.com",
pathname: "/**",
},
],
},
poweredByHeader: false,
compress: false,
};
export default nextConfig;01Features
Built for the part of Next.js setup that is easy to get subtly wrong: deployment settings, image hosts, headers and caching.
Every toggle is checked against the others as you go. A static export with rewrites, a wildcard CORS origin with credentials, an open image host: each shows up with a clear label and a button that jumps to the option involved.
All 60 options carry four short answers: why you would use it, when not to, what it does in production, and the mistake people usually make.
Pick the preset closest to your setup, then adjust. You never have to start from an empty file.
Get next.config.ts, or JavaScript as ESM (next.config.mjs) or CommonJS (next.config.js). The file name and import style follow your choice.
Type docker, cors or cache and the list narrows by option name, description and related terms, not just exact key names.
Image hosts, redirects, rewrites, headers and CORS origins use rows and dropdowns, so you choose a protocol instead of remembering how to spell it.
Everything runs in your browser. Nothing you toggle or type is uploaded, logged or saved when you close the tab.
Copy the file to your clipboard or download it under the right name, ready for the project root.
02Compared
All three work. They differ in how many surprises are left for build time.
Copy an old config
Write it from the docs
This generator
Old configFits the last app, not necessarily this one.
From the docsFits, if you read every page that applies.
This generatorStarts from a preset for your target.
Old configFound at build time or in production.
From the docsFound when you happen to notice.
This generatorFlagged the moment you toggle.
Old configRarely. The comments got lost on the way.
From the docsThoroughly, one page per option.
This generatorWhy, when not to, impact and a common mistake, on every option.
Old configAccess to an old project.
From the docsA lot of reading time.
This generatorA browser tab. Nothing to install.
Old configSmall tweaks you already understand.
From the docsOptions the generator does not cover.
This generatorA first working file that avoids the known traps.
03How to use
On a wide screen the options sit beside the live file. On a phone you switch between Configure and Output. Either way there is nothing to install and nothing to save.
Choose the preset closest to your deployment: Vercel production, Docker, Kubernetes, static export, nginx, monorepo, CDN, security hardened, maximum performance or minimal. Prefer a blank slate? Only React Strict Mode is on.
The file on the right fills in at once
Filter by target (Vercel, Docker, Kubernetes, nginx, Redis, CDN, static export, monorepo) or search for a word like cors, cache or docker. Search reads option names, descriptions and related terms.
Only options that matter for that target stay
Each toggle opens its own fields right underneath: a dropdown, a number, a tag box or a list of rows. Nothing opens in another page or a popup.
The matching keys appear in the file
Type your image hosts, allowed CORS origins, redirects and headers. Protocols come from a dropdown, and you can add as many hosts or rules as you need. The question mark on any row gives the short guidance.
Empty or duplicate rows get flagged
Conflicts, things worth checking and notes are listed with a button that jumps to the option behind each one. Fix them here instead of at build time.
A red count when something will break
Pick TypeScript or JavaScript, then ESM or CommonJS if you chose JavaScript. The file is named next.config.ts, next.config.mjs or next.config.js to match. Put it next to package.json and run your build.
A file that is ready for the project root
04Checks
These run on every change, and the labels match the tab. Conflict means the build or the browser will reject it. Check this means it works but is probably a mistake. Note is worth knowing.
Conflict
when output is "export" and rewrites, redirects, response headers, a cache handler or an expire time are on
A static export ships no server, so none of these can run. Move them to the host that serves the files.
Conflict
when output is "export" and image optimization is still on
The optimizer is a server route, so images fail. Turn it off or point to an image CDN loader.
Conflict
when a wildcard CORS origin is paired with credentials
Browsers refuse that pairing, so every request that carries cookies fails.
Conflict
when a bare * is allowed as an image host
Anyone can push images through your optimizer. A pattern like *.example.com is a lighter Check this.
Conflict
when SVG images are allowed without the attachment disposition
An SVG can carry script, which becomes stored XSS on your own domain.
Check this
when images.domains is used, or sits next to remotePatterns
The old list only matches hostnames and is deprecated. Move every host into remotePatterns.
Check this
when a custom cache handler is set without the in-memory cache size set
Each pod keeps a local copy, so a revalidated page can look stale on some of them.
Check this
when an X-Robots-Tag noindex header is on
It hides every response from search engines. Keep it for staging only.
Note
when more than one CORS origin is listed
A header carries one origin, so the file emits the first and flags the rest. Echo the match from middleware.
05Real setups
The snippets are real generator output, trimmed for space. Each one starts from a preset and changes only what the project needs.
Static export preset
No server logic at all, hosted from plain object storage.
const nextConfig: NextConfig = {
reactStrictMode: true,
output: "export",
trailingSlash: true,
images: {
unoptimized: true,
},
};Plain HTML the bucket can serve, with URLs shaped the way static hosts expect.
Kubernetes preset
Several pods behind a load balancer sharing one Redis instance.
output: "standalone",
poweredByHeader: false,
generateEtags: false,
compress: false,
cacheHandler: path.resolve("./cache-handler.mjs"),
cacheMaxMemorySize: 0,A small image, and every pod reads ISR pages from the same cache.
Vercel production preset
Avatars and attachments served from Cloudinary, no container step.
images: {
remotePatterns: [
{
protocol: "https",
hostname: "res.cloudinary.com",
pathname: "/**",
},
],
formats: ["image/avif", "image/webp"],
},One allowed image host, modern formats, and no framework header leaking out.
Security hardened preset
A REST API that only one origin may call from a browser.
{
source: "/api/:path*",
headers: [
{
key: "Access-Control-Allow-Origin",
value: "https://app.example.com",
},
{
key: "Access-Control-Allow-Methods",
value: "GET, POST, OPTIONS",
},
],
},CORS scoped to the API route, written into a single generated headers() block.
06Good to know
A config tool is only useful if you know where it stops. The official next.config reference stays the source of truth.
That is 60 options in eight groups, not every key in the reference. For anything else, add it by hand and keep the official reference open.
next.config.ts needs Next.js 15 or newer, and options get renamed or promoted between majors. Next.js 16, for example, moved turbopack and reactCompiler out of experimental. Check any experimental key against the docs for the version you run.
The checks catch known traps, not mistakes that depend on your project, like which image hosts are really yours. Read the Issues tab, then run your build once before you deploy.
07FAQ
Straight answers about accuracy, the static export error, image hosts, CORS and privacy.
No. Presets cover the common deployment targets, and every option comes with a short description plus a Learn more explaining what it's for. You can build a working config without knowing what outputFileTracingRoot means going in.
It's syntactically complete and cross-checked for conflicts, but it still reflects choices only you can make, like which image hosts are really yours or which origins should be trusted. Treat the Issues tab as a second pair of eyes, not a substitute for reading what you turned on.
A static export has no Next.js server running when someone visits the site, and rewrites are resolved by that server. The fix isn't in next.config at all, it's moving the rule to whatever host is actually serving the static files.
domains only checks the hostname. remotePatterns also checks protocol, port, and path, which is the part that actually stops a stranger from optimizing arbitrary images through your server. The old key still works but is on its way out.
Both. next.config.ts needs Next.js 15 or newer and gives you typed options. It uses export default, but imports inside a .ts config are resolved the CommonJS way, so a package that ships only as ESM can fail to load there. If that happens, use next.config.mjs. JavaScript output lets you choose ESM (next.config.mjs) or CommonJS (next.config.js).
Origins, methods, allowed headers, and the credentials flag all merge into a single generated headers() block, grouped by the route pattern you set. If you list more than one allowed origin, it flags that you'll need middleware to echo back the matching one, since a header can only carry one value.
Only once more than one instance of your app is serving the same pages. A single server or a Vercel deployment already keeps this consistent on its own. On Kubernetes or behind Docker replicas, each container otherwise holds its own copy of the ISR cache.
No. Every option you toggle stays in your browser tab and is used only to render the file on screen. Nothing is uploaded, logged, or saved once you close the page.
It sits in the root of your project, next to package.json. It is optional: a Next.js app runs on its defaults without one, and you add the file when you need to change something such as images, headers or the build output.
Yes. The file is read when Next.js starts and when you build, so a change only takes effect after a restart or a new build. The dev server usually restarts itself when it notices the file changed.
It is free and needs no signup. Open the page, build the file, then copy or download it.




© 2026 UntangleTools. All Rights Reserved.