CSP Security Header Builder
Pick sources for each directive below. Your Content-Security-Policy is generated live, with server snippets for Apache and Nginx.
Preset:
Strict: only your own domain, no frames, no plugins — strongest protection.
Security warning
Note: frame-ancestors and reporting directives are ignored inside a <meta> tag. Use the real HTTP header on your server for full protection.
HTTP header
Meta tag version
Apache (.htaccess)
Nginx snippet
How to read a directive
'self'— only your own domain (same scheme and host).'none'— blocks everything for that directive.https:— any source over HTTPS.data:/blob:— inline data URLs, useful for images.'unsafe-inline'— allows inline scripts and styles; weakens XSS protection.'unsafe-eval'— allowseval()and similar; avoid unless a library truly needs it.