Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

Security Headers

Direct answer

Security headers instruct browsers to apply protections: Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options: nosniff, Referrer-Policy, Permissions-Policy and frame-ancestors or X-Frame-Options.

When to use this

Use this when adding browser security headers.

First 30 seconds

1. Security headers harden browsers.

2. CSP, HSTS, nosniff, Referrer-Policy, Permissions-Policy, frame-ancestors (or X-Frame-Options).

3. Set at proxy or app.

4. Test after changes.

5. Don't rely on deprecated X-XSS-Protection.

Operational verification

response → headers → browser enforcement

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Security architecture and operations
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformSecurity architecture and operations
Key commandcurl -sI https://example.com
Scope / prerequisiteUse this when adding browser security headers.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Checking headers Verify boundary
curl -sI https://example.com

Expected: Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options: nosniff, Referrer-Policy, Permissions-Policy, and frame-ancestors in CSP (or X-Frame-Options). Use securityheaders.com or Mozilla Observatory for a graded report.

Step 2 Common mistakes Narrow the fault
  • Headers set on some responses only.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Key headers: CSP, HSTS, X-Content-Type-Options, Referrer-Policy, frame-ancestors.
  • Test before enforcing.
  • Scan regularly.
Key checks
  • curl -sI https://<site> — headers present
  • securityheaders.com-style check — grading
  • Headers: CSP, HSTS, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, frame-ancestors — set
ReferenceWhy it matters1 section · depth on demand

Recommended headers

HeaderExample value
Strict-Transport-Securitymax-age=31536000; includeSubDomains
Content-Security-Policydefault-src 'self'; frame-ancestors 'none'
X-Content-Type-Optionsnosniff
Referrer-Policystrict-origin-when-cross-origin
Permissions-Policycamera=(), microphone=(), geolocation=()

X-Frame-Options is replaced by CSP frame-ancestors but is still useful for old browsers. Check with curl -I https://site or securityheaders.com.

ReferenceImportant terms & boundaries2 sections · depth on demand

Nginx example

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" 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=()" always;
add_header Content-Security-Policy "default-src 'self'; frame-ancestors 'none'" always;

Documented example, not captured output. add_header in a nested block replaces headers set at a higher level.

In depth

Security headers are HTTP response headers that instruct browsers to enable protections. They are cheap to add and mitigate several common attack classes.

HeaderPurposeExample value
Strict-Transport-SecurityHTTPS onlymax-age=31536000; includeSubDomains
Content-Security-PolicyRestrict scripts and resources; frame-ancestorsdefault-src 'self'; frame-ancestors 'none'
X-Content-Type-OptionsNo MIME sniffingnosniff
Referrer-PolicyLimit referrer leakagestrict-origin-when-cross-origin
Permissions-PolicyDisable browser featurescamera=(), microphone=(), geolocation=()
Cross-Origin-Opener-PolicyIsolate browsing contextsame-origin

Set headers centrally on the reverse proxy or framework, and test with browser developer tools or online header scanners. X-XSS-Protection is obsolete — rely on CSP instead.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docSecurity architecture and operations current

Authoritative/upstream documentation reviewed for bounded claims in Web Security → Security Headers. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://owasp.org/www-project-application-security-verification-standard/ · confidence 94%
Confirmation

Confirm action

Continue?