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.

    评论

报告相同问题?

悬赏问题

  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法