What security headers are — and why they matter
HTTP security headers are instructions your server sends with every page that tell the browser how to
behave defensively. They are one of the cheapest, highest-leverage protections you can add: no code
change, just configuration. Miss them and you leave the door open to cross-site scripting (XSS),
clickjacking, protocol downgrade and MIME-sniffing attacks.
Content-Security-Policy (CSP)
Controls which scripts, styles and resources may load — the single most effective defense against XSS.
Strict-Transport-Security (HSTS)
Forces HTTPS so a network attacker can’t downgrade visitors to plain HTTP.
X-Content-Type-Options
nosniff stops the browser guessing content types and running files as scripts.
X-Frame-Options / frame-ancestors
Blocks your pages being embedded in a hostile iframe (clickjacking).