Refused to display in a frame: X-Frame-Options sameorigin
The page you try to embed sends X-Frame-Options: SAMEORIGIN. The browser shows it only inside frames on the same origin, so your iframe stays empty.
- Chrome
- Edge
- Firefox
- Safari
Updated
Refused to display 'https://example.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
The frame shows a gray page: “example.com refused to connect.”
Refused to display 'https://example.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
The frame shows “Firefox Can’t Open This Page”.
The loading of “https://example.com/” in a frame is denied by “X-Frame-Options“ directive set to “sameorigin“.
The frame stays blank. There is no message in the page.
Refused to display 'https://example.com/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
On this page
What it means
Why it happens
Check the page
See the headers the page sends now
Fix it if you own the site
location / {
proxy_hide_header X-Frame-Options;
add_header Content-Security-Policy "frame-ancestors 'self' https://your-site.com" always;
}Do not use X-Frame-Options ALLOW-FROM. Modern browsers ignore it. Do not add * to frame-ancestors unless any site may embed the page.
If you do not own the site
- Use the official embed URL
YouTube, Google Maps, Calendly, and others give a special embed link that allows frames.
- Link out instead
Open the page in a new tab with a normal link, or show a preview card that links to it.
- Ask the owner
Ask them to add your site to frame-ancestors. Send them this page.