Security Headers Generator
Generate hardened HTTP security headers for Nginx and Apache.
Generate hardened HTTP security headers for Nginx and Apache. Enter your numbers and get an instant result.
Pick the target server, the CSP level and HSTS, and the page returns hardened HTTP security headers rendered in that server's syntax.
This page executes on the tool server: the target, the strict, balanced or permissive CSP level and the HSTS flag are sent for that one request, the snippet is rendered there, and nothing is stored. Nginx, Apache, Cloudflare or a generic snippet all describe the same headers in different syntax.
The output is configuration text, not a deployment: it states the policy, and applying and testing it stay with your own server.
What the generator covers
The snippet carries the standard set — content security policy at the chosen level, strict transport security when included, frame options, content type options and referrer policy — each line set for the target's format.
Balanced is the middle default; strict locks the policy down and permissive relaxes it. The level tunes only the policy line, and HSTS defaults to included.
- Nginx, Apache, Cloudflare or generic
- CSP strict, balanced or permissive
- HSTS included unless turned off
What is sent and what is kept
The request carries the three options, and the response carries the snippet. Neither is written to disk or logged; regenerating for another target is a fresh request with no memory of the last one.
The page writes policy text; it never contacts any server. Whether the headers suit the site is verified by deploying and reading the real responses.
How to use the target and level
Pick the target server, Nginx, Apache, Cloudflare or a generic snippet, the CSP level, strict, balanced or permissive, and the HSTS flag, then press Execute Tool Engine. The snippet carries content security policy at the chosen level with strict transport security when included, plus frame options, content type options and referrer policy, each line set for the target's format.
Balanced is the middle default and HSTS defaults to included; the level tunes only the policy line. The page writes policy text and never contacts a server, so whether the headers suit the site is verified by deploying and reading the real responses.
What to Expect
Best for
- Adding a CSP to an Nginx or Apache site
- Starting Cloudflare response headers
- Comparing strict versus balanced policies
Not ideal for
- Auditing headers already deployed
- Site-specific allow-lists without review
- Replacing a full security review
What this tool keeps
- The options exactly as chosen
- The same snippet for the same options
- Your inputs private beyond the single request
What may need cleanup
- Allowing the scripts and frames the site needs
- Turning HSTS off where TLS is not yet fronting
- Testing the real responses after applying
Common errors
- Deploying strict without allowing own assets
- Enabling HSTS before TLS is in place
- Pasting the wrong target's syntax
Example use cases
- Hardening a new Nginx vhost
- Drafting an Apache header block
- Starting a Cloudflare policy
Sample input
Nginx target with the balanced CSP level and HSTS included, generated as a snippet.
Sample output
The hardened header block in Nginx syntax with the policy at the chosen level, rendered on the tool server.
Who this is for
- Developers hardening deployments
- Operators writing server configs
- Anyone starting a header policy
Frequently asked questions
Which servers does it target?
Nginx, Apache, Cloudflare or a generic snippet. The target switch reshapes the same headers into that server's syntax.
What do the CSP levels mean?
Strict locks the content security policy down, balanced is the middle default, and permissive relaxes it. The level only tunes the policy line.
What does include HSTS do?
It adds the strict transport security header, on by default. Turn it off where TLS is not yet in front of the site.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.