Skip to main content

Security Headers

This section uses a single On/Off switch at the top. Off deletes all of the domain's custom security headers (standard and custom), so no headers are added.

Security Headers let the edge add security headers to responses without changing your origin: X-Content-Type-Options, X-Frame-Options, X-XSS-Protection, Content-Security-Policy (CSP), Referrer-Policy, Permissions-Policy, plus a list of arbitrary custom headers.

Use it when you want to set security headers centrally at the CDN (against clickjacking and MIME sniffing, to limit referrer data, and so on) for every page on the domain. Example: set X-Frame-Options: DENY so your pages cannot be embedded in an iframe on another site.

Before you start​

  • The domain has been added and points to VNIS.
  • If you use CSP, prepare a correct policy string in advance (an incorrect CSP can break how the page renders).

How to configure​

This section uses a single On/Off switch at the top: On creates and applies the security header set (saved immediately); Off deletes all custom security headers for the domain. The fields are shown even when the switch is Off (as a draft), so you can fill them in first and then switch On.

  1. Go to Domains → select a domain → Security Headers tab. Go to Domains → select a domain → Security Headers tab
  2. Choose values for the standard headers (for example X-Frame-Options = DENY, X-Content-Type-Options = nosniff). Leaving a field empty means that header is not set.
  3. (Optional) Add Custom Headers — enter a name and a value.
  4. Turn the switch On at the top of the section. For later edits, click Save (shown only when the switch is On and there are unsaved changes).

Configuration fields​

FieldMeaningValuesDefaultNotes
X-Content-Type-OptionsStops the browser from guessing the content typenosniff or emptyEmptyOnly nosniff/empty is accepted; any other value → 400 error
X-Frame-OptionsPrevents iframe embedding (clickjacking)DENY / SAMEORIGIN / emptyEmpty—
X-XSS-ProtectionEnables the browser's legacy XSS filter1; mode=block / 1 / 0 / emptyEmptyChoose a value from the dropdown
Content-Security-PolicyCSP policyString, ≤ 16 KiB, no CR/LFEmptyInvalid format → 400; an incorrect CSP can block the page's own JS/CSS
Referrer-PolicyPolicy for sending RefererStringEmptyUse a standard value (the dropdown suggests them)
Permissions-PolicyRestricts browser permissions (camera, microphone, and so on)String, ≤ 16 KiB, no CR/LFEmpty—
Custom HeadersArbitrary headers≤ 50 headers—Names must be standard (no :, no spaces); values ≤ 8 KiB, no CR/LF

Important difference between standard and custom headers:

  • Standard headers (the 6 fields above) are added only when the response does not already have that header — that is, they do not overwrite a header returned by the origin.
  • Custom headers always overwrite a header with the same name in the response.

Configuration examples​

Example: A basic security header set for a website.

  • X-Frame-Options: DENY — prevents the page from being embedded in an iframe (against clickjacking).
  • X-Content-Type-Options: nosniff — stops the browser from guessing the content type.
  • Referrer-Policy: strict-origin-when-cross-origin — limits URL leakage through the Referer header.
  • Content-Security-Policy: start with the minimal policy default-src 'self' (test it in a test environment first — an overly strict CSP can block the page's own JS/CSS).
  • Note: the 6 standard headers are added only when the response does not already have that header (they do not overwrite the origin). To force an overwrite, use Header Rules with the set action.
  • Check: curl -I https://example.com/ → you see x-frame-options: DENY and x-content-type-options: nosniff.

Order of evaluation​

  • The On/Off switch controls whether the configuration exists: On creates the security header record; Off deletes all custom security headers for the domain (no headers are added).
  • Standard headers do not overwrite the origin: if the origin already returns X-Frame-Options: SAMEORIGIN, your DENY setting does not overwrite it — visitors still receive SAMEORIGIN.
  • Custom headers overwrite: a custom header always replaces a header with the same name.
  • HSTS is not configured here — Strict-Transport-Security is controlled by the TLS tab (or the system default) and is sent only over HTTPS connections.
  • Some headers managed by the CDN itself (such as Via) are not affected by this feature.

Troubleshooting​

SymptomCommon causeFix
Saving returns 400 on X-Frame-OptionsThe value is not DENY/SAMEORIGIN/emptyChoose a valid value from the dropdown
Saving returns 400 on X-Content-Type-OptionsThe value is not nosniffUse nosniff or leave it empty
Saving returns 400 on CSPThe CSP contains line breaks (CR/LF) or is > 16 KiBRemove line breaks and shorten the policy
The header is set but does not appear in the responseThe origin already returns that header (standard headers do not overwrite the origin)Use Header Rules with the set action if you need to overwrite it, or change the origin
Saving a custom header returns 400The name contains :/spaces, there are more than 50 headers, or the value contains CR/LFFix it according to the limits in Configuration fields

FAQ​

  • Why do I set X-Frame-Options but visitors still don't see it? Because the origin already returns that header — standard headers are added only when the response does not have them. To force an overwrite, use Header Rules (set).
  • Which values should I use for X-XSS-Protection/Referrer-Policy? Use the values offered in the dropdown; browsers may ignore an incorrect value.
  • Is an incorrect CSP dangerous? Yes. An overly strict CSP can block your page's own JS/CSS. Test it in a test environment first.
  • Where do I set HSTS? In the TLS tab, not here.