Skip to content

Commit c788d98

Browse files
authored
docs: Provide iframe embed solution (#440)
* Provide iframe embed solution * Update index.mdx
1 parent 4d624e6 commit c788d98

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

docs/widgets/iframe/index.mdx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,24 @@ for security reasons, as users could easily be tricked
4242
by embeding the original site on a malicious page.
4343

4444
Some proxies disallow iframes by default for this reason.
45-
You can use https://iframetester.com/ to check, if the site is allowing iframes.
46-
If you manage all of your own applications, you can usually change that.
45+
You can use https://iframetest.com to check, if the site is allowing iframes.
46+
47+
If you manage all of your own applications, you can usually change that by configuring
48+
the appropriate headers (such as `X-Frame-Options` or `Content-Security-Policy`) to allow iframes.
49+
50+
For example, to allow your site to be embedded in iframes from specific domains:
51+
52+
**Apache (.htaccess or httpd.conf):**
53+
```apache
54+
Header set Content-Security-Policy "frame-ancestors 'self' https://trusted-domain.com"
55+
Header set X-Frame-Options "ALLOW-FROM https://trusted-domain.com"
56+
```
57+
58+
**Nginx:**
59+
```nginx
60+
add_header Content-Security-Policy "frame-ancestors 'self' https://trusted-domain.com";
61+
add_header X-Frame-Options "ALLOW-FROM https://trusted-domain.com";
62+
```
4763

4864
### Example URLs
4965

0 commit comments

Comments
 (0)