HTTP Security Headers & CSP Generator

Build Content-Security-Policy (CSP), HSTS & X-Frame-Options headers and export for Cloudflare Pages, Nginx, or Vercel.

🔒 100% Client-Side • Zero Uploads
Cloud Actors • Pay-per-Use

Turn Manual Data Workflows into Scheduled Cloud Scrapers

Need clean structured JSON/CSV feeds from Hacker News, Bluesky, Substack, Podcasts, or Remote Job boards without writing crawlers? Explore ready-to-run Apify Actors.

Browse Actors on Apify Store →
EthicalAds / Carbon / AdSense Slot 0 CLS
Automate Web Scraping & Edge APIs

Using CSP & Security Headers manually? Batch-process live URLs with CleanPage Edge API or Apify Cloud Actors.

Explore Cloud Automation →

Recommended Hosting & SaaS Stack

Affiliate Partners
Up to 60% Partner Tier Hostinger Cloud & Web Hosting

NVMe SSD hosting + free domain & SSL for launching static or WordPress client sites fast.

Check Hosting Plans →
Free WhoisGuard Namecheap Domains & SSL

Register clean .com / .dev / .ai domains with free lifetime Whois privacy and fast DNS.

Search Domains →
Developer Favorite DigitalOcean Droplets & App Platform

Deploy Node.js APIs, containers, and managed Postgres databases with predictable developer pricing.

Claim Developer Credit →

How to Use CSP & Security Headers & Key Capabilities

Quick Workflow

  1. Customize allowed origins for scripts, styles, images, and API connect-src domains.
  2. Choose target format: Cloudflare Pages _headers, Nginx, or Vercel JSON.
  3. Copy or download the file into your deployment root and test headers after deploy.

Built-In Capabilities

  • Builds complete Content-Security-Policy directives (default-src, script-src, style-src, img-src, frame-ancestors)
  • One-click format switching for Cloudflare Pages _headers, Nginx add_header, and vercel.json
  • Includes HSTS preload, X-Content-Type-Options: nosniff, and strict Referrer-Policy

Frequently Asked Questions

Where do I put the _headers file in Cloudflare Pages?

Place _headers at the root of your published static build output directory (e.g. dist/_headers) — Cloudflare Pages applies it automatically.

Why set frame-ancestors alongside X-Frame-Options?

frame-ancestors in CSP supersedes X-Frame-Options in modern browsers while X-Frame-Options covers legacy clients against clickjacking.

When should I avoid unsafe-inline in script-src?

Avoid unsafe-inline in script-src whenever possible; prefer external module scripts or cryptographic nonces to stop XSS.

Does HSTS preload require subdomains to support HTTPS?

Yes — only enable includeSubDomains and preload once every subdomain serves valid HTTPS.