Closed
Description
Summary
The v4 release notes announce Full support for Next.js rewrites, redirects and headers.
but I can't make the headers work on Netlify deployment.
It does work on next dev
and next build && next start
, but it does not work after deploying it on Netlify.
Steps to reproduce
- Add
headers
function tonext.config.js
- Deploy the app on Netlify
- The custom headers are not there
A link to a reproduction repository
No response
Plugin version
4.0.0
More information about your build
- I am building using the CLI
- I am building using file-based configuration (
netlify.toml
)
What OS are you using?
Mac OS
Your netlify.toml file
`netlify.toml`
# Paste content of your `netlify.toml` file here
Your public/_redirects file
`_redirects`
# Paste content of your `_redirects` file here
Your next.config.js
file
`next.config.js`
...
headers: () => ([
{
source: "/fonts/(.*).otf",
headers: [
{
key: "Cache-Control",
value: "public, max-age: 31536000, immutable",
},
],
},
]),
...
Builds logs (or link to your logs)
Build logs
# Paste logs here
Function logs
Function logs
# Paste logs here
.next JSON files
generated .next JSON files
# Paste file contents here. Please check there isn't any private info in them
# You can either build locally, or download the deploy from Netlify by clicking the arrow next to the deploy time.