Netzli Docs

Headers

A file named _headers next to _redirects sets response headers, in Netlify's format: a path on its own line, then its headers, each indented on its own line.

_headers
/*
  X-Frame-Options: DENY
  Referrer-Policy: strict-origin-when-cross-origin
  Content-Security-Policy: default-src 'self'

/assets/*
  Cache-Control: public, max-age=31536000, immutable
  • A * matches any characters, slashes included. A :name matches one part of the path between slashes. The query string doesn't count.
  • When several matching paths set the same header, the last one in the file wins.
  • The headers go on your site's files, its 404 page included, but not on redirects or on answers from another website.
  • Values are sent exactly as written. Only \ and {$ aren't allowed.
  • Netzli refuses Set-Cookie, Netlify's Basic-Auth and the headers its web server sets itself, such as Content-Length, Date and Server.
  • Netzli already sends X-Content-Type-Options: nosniff.

As with _redirects, a line Netzli can't use is skipped and named on the deployment page.