X Frame-Options标头不是可识别的指令

问题描述 投票:6回答:1

我现在使用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.

有人知道为什么这不起作用,提前谢谢。

nginx http-headers nextcloud
1个回答
9
投票

回到这篇文章。不幸的是我发现了问题。 Chrome不支持此选项,因此Chrome会向我提供错误,即iframe将我重定向到很多次。

但是该选项适用于Firefox(更多信息请访问:https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options)。

© www.soinside.com 2019 - 2024. All rights reserved.