X-Frame-Options头部不是一个被认可的指令。

18

我已经使用Nextcloud(在Nginx上)一段时间了,我想将其嵌入到另一个网站的iframe中。但是标题不接受我的指令。

我将 /var/www/nextcloud/lib/private/legacy/response.php 中的头部选项更改为以下内容:

header('X-Frame-Options: ALLOW-FROM https://example.com');

然而当我创建一个包含iframe的示例网页时,它给出以下错误:

Invalid 'X-Frame-Options' header encountered when loading 'https://nextcloud.example.com/apps/files/': 'ALLOW-FROM https://example.com' is not a recognized directive. The header will be ignored.

有没有人知道为什么这样不起作用?

2个回答

29

14

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接