douyong7199 2019-05-03 05:57 采纳率: 0%
浏览 3012

X-Frame-Options未明确设置为sameorigin,但Nginx阻止将页面呈现为iframe

我没有在 nginx 中将 x-frame-options 显式地设置为 sameorigin,但是 nginx 阻止了在 iframe 中呈现的 html 页面。我在 X-Frame-Options 中尝试指定域名,但没有成功。我把它们通读了一遍,尝试了一些修复方法,但都没有用。

https://preview.codecanyon.net/item/product-name/product-id

在 iframe 中预览我的 HTML 页面。

  • 写回答

2条回答 默认 最新

  • dongshiran7000 2019-05-03 16:54
    关注

    The problem is not about X-Frame-Options but Content-Security-Policy also. Codecanyon set an CSP header that prevent the other sites can frame in their site. Even you allow all sites in your XFO header, they can block your site display in their website with CSP header.

    But they are a market, they have to open a way for developer to include an iframe in their preview page. Seems they're not implemented a way for developer provide frame-src in preview page. So Codecanyon's CSP header is in Report only mode. All things is running fine although a lot of error you see from Chrome Developer Console.

    enter image description here


    By the way, you implemented an syntax error CSP header: unexpected punctuation at the start.

    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记