CDN Support with Asset Prefix

    To set up a CDN, you can set up an asset prefix and configure your CDN’s origin to resolve to the domain that Next.js is hosted on.

    Next.js will automatically use your asset prefix for the JavaScript and CSS files it loads from the /_next/ path ( folder). For example, with the above configuration, the following request for a JS chunk:

    Would instead become:

    While covers requests to _next/static, it does not influence the following paths:

    Introduction to next.config.jsLearn more about the configuration file used by Next.js.