Security headers generator
Choose your options and copy a ready-to-paste config. The defaults are a safe starting point for most sites and score well on common header scanners.
What each header does
Strict-Transport-Security (HSTS) tells browsers to always use HTTPS for your domain. Only add preload if every subdomain supports HTTPS.
Content-Security-Policy (CSP) limits where scripts, styles and frames can load from, which blocks most XSS. Start in report-only mode, watch the browser console, then enforce.
X-Frame-Options / frame-ancestors stop other sites from embedding yours in an iframe (clickjacking).
X-Content-Type-Options: nosniff stops browsers guessing file types. Referrer-Policy controls how much of your URL is sent to other sites. Permissions-Policy turns off browser features you don't use.