Frame-ancestors header generator
Choose who may embed your site. Get the Content-Security-Policy header and the config for your server.
Updated
Adds X-Frame-Options: SAMEORIGIN, for browsers that do not support frame-ancestors.
Browsers report a block but do not stop it. Uses Content-Security-Policy-Report-Only.
nginx.conf · inside your server { } block
add_header Content-Security-Policy "frame-ancestors 'self'" always; add_header X-Frame-Options "SAMEORIGIN" always;
Content-Security-Policy
X-Frame-Options
Allowed origins
Test it after deploy
Paste a page from your site. We read its headers and try to frame it.
How frame-ancestors works
The browser reads this header on your page. It then checks the site that tries to frame it. Send it as an HTTP header. It does not work in a meta tag.
- 01
It wins over X-Frame-Options
When a page sends both headers, modern browsers use frame-ancestors and ignore X-Frame-Options. Keep X-Frame-Options only as a fallback for old browsers.
- 02
There is no ALLOW-FROM
X-Frame-Options: ALLOW-FROM is obsolete. Current browsers ignore it. To allow other sites, list them in frame-ancestors.
- 03
Wildcards cover subdomains only
https://*.partner.com matches app.partner.com and eu.app.partner.com. It does not match partner.com. Add the bare domain as its own entry.