【问题标题】:IE 11 this page cannot be displayed in a frameIE 11 此页面无法在框架中显示
【发布时间】:2017-09-13 20:00:22
【问题描述】:

在 WordPress 页面中有一个 iframe 标签,其 src (N page) 不是同一个来源。

  1. 我检查了N页的http头包含
    X-Frame-Options: ALLOW-FROM *.mydomain.com;
    Content-Security-Policy: frame-ancestors *.mydomain.com
    X-XSS-protection: 0
    它们完全被 proxy_hide_header 覆盖,Set-Cookie 标头也被 proxy_hide_header 隐藏。

  2. 但它仍然无法在 IE 11 中运行,但在 chrome 或 safari 中运行。

我不知道为什么..

【问题讨论】:

  • ALLOW-FROM 必须是 URI,而不是通配符
  • @AlexeyTen 谢谢!!

标签: nginx iframe content-security-policy x-frame-options


【解决方案1】:

感谢@Alexey 十

X-Frame-Options ALLOW-FROM 需要URI 格式。

我测试过,它适用于 IE11、10、9 和 8。

我的 nginx.conf 只有

proxy_hide_header 'X-Frame-Options'; # this should be needed
add_header 'X-Frame-Options' 'ALLOW-FROM http://sub.example.com';
add_header 'Content-Security-Policy' 'frame-ancestors http://sub.example.com';

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-07-11
    • 2016-03-31
    • 2012-12-17
    • 2019-06-03
    • 1970-01-01
    • 2020-08-19
    相关资源
    最近更新 更多