Security Presets
Start with balanced, strict, or app-friendly policies.
Generate CSP, HSTS, Referrer-Policy, Permissions-Policy, and other security headers.
Security headers
Generate baseline security headers for static sites and web apps.
HTTP headers
Drop into your edge or proxy config.
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self' Strict-Transport-Security: max-age=31536000; includeSubDomains X-Frame-Options: DENY X-Content-Type-Options: nosniff Referrer-Policy: strict-origin-when-cross-origin Permissions-Policy: camera=(), microphone=(), geolocation=(), payment=() Cross-Origin-Opener-Policy: same-origin
Nginx
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header X-Frame-Options "DENY" always; add_header X-Content-Type-Options "nosniff" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()" always; add_header Cross-Origin-Opener-Policy "same-origin" always;
Next.js headers()
async headers() {
return [
{
source: '/(.*)',
headers: [
{ key: 'Content-Security-Policy', value: 'default-src \'self\'; script-src \'self\'; style-src \'self\' \'unsafe-inline\'; img-src \'self\' data: https:; font-src \'self\' data:; connect-src \'self\'; frame-ancestors \'none\'; base-uri \'self\'; form-action \'self\'' },
{ key: 'Strict-Transport-Security', value: 'max-age=31536000; includeSubDomains' },
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
{ key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=(), payment=()' },
{ key: 'Cross-Origin-Opener-Policy', value: 'same-origin' },
],
},
];
}Capabilities
Use Security Headers Generator to check the input, tune the settings, and copy a clean output.
Start with balanced, strict, or app-friendly policies.
Generate deploy-ready security headers.
Copy Nginx and Next.js header examples.
Workflow
Create baseline security headers for websites and apps.
Choose balanced, strict, or app-friendly header defaults.
Adjust CSP, HSTS, referrer, and permissions policies.
Copy raw headers, Nginx config, or Next.js headers.
Good for
FAQ
Practical notes about output, privacy, and common settings.
Use next