# X-Content-Type-Options: nosniff

DevFeed: [X-Content-Type-Options: nosniff](<https://devfeed.tech/articles/x-content-type-options-nosniff-89185.md>)

Original publisher: [Read original article](<https://specification.website/spec/security/x-content-type-options/>)

Author: Joost de Valk

Published: 2026-05-29T09:13:20Z

Content type: article

Language: en

Sources: [The Website Specification](<https://devfeed.tech/sources/the-website-specification.md>)

Topics: [bookstack security](<https://devfeed.tech/topics/bookstack-security.md>), [nginx](<https://devfeed.tech/topics/nginx.md>)

Tags: [apache](<https://devfeed.tech/tags/apache.md>), [attacks](<https://devfeed.tech/tags/attacks.md>), [audit](<https://devfeed.tech/tags/audit.md>), [browsers](<https://devfeed.tech/tags/browsers.md>), [cdn](<https://devfeed.tech/tags/cdn.md>), [content-type](<https://devfeed.tech/tags/content-type.md>), [css](<https://devfeed.tech/tags/css.md>), [curl](<https://devfeed.tech/tags/curl.md>), [express](<https://devfeed.tech/tags/express.md>), [header](<https://devfeed.tech/tags/header.md>), [implement](<https://devfeed.tech/tags/implement.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [layer](<https://devfeed.tech/tags/layer.md>), [mdn](<https://devfeed.tech/tags/mdn.md>), [mime](<https://devfeed.tech/tags/mime.md>), [nginx](<https://devfeed.tech/tags/nginx.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [owasp](<https://devfeed.tech/tags/owasp.md>), [production](<https://devfeed.tech/tags/production.md>), [required](<https://devfeed.tech/tags/required.md>), [script](<https://devfeed.tech/tags/script.md>), [security](<https://devfeed.tech/tags/security.md>)

## AI overview

`X-Content-Type-Options: nosniff` tells browsers to honor the response's declared `Content-Type`. The excerpt says browsers block script and stylesheet responses whose MIME type does not match, reducing the risk that uploaded files are interpreted as executable content. Set the single value `nosniff` on every response; examples include Nginx, Apache, Express with Helmet, and CDN or edge configuration. Pair it with accurate MIME types, since mislabeled scripts or stylesheets may stop working. There is no report-only mode. Verify the header on production responses and check origin, CDN, and static-host layers because they may strip or override it.

## Source excerpt

The nosniff header stops browsers from guessing a response's content type. It blocks a class of attacks where a benign-looking file is interpreted as script or stylesheet.