【问题标题】:I want to server my iFrame content to another server (cross-domain)我想将我的 iFrame 内容提供给另一台服务器(跨域)
【发布时间】:2013-08-09 01:49:56
【问题描述】:

我想知道是否有人可以告诉我哪些 Apache 或 HTML 设置会影响 iframe 从不同域加载内容的能力。我不想在两个域之间进行通信,只是简单地加载一些 HTML,但我不能,我不知道为什么。我怀疑一些 Apache 配置,但我不确定。

为了澄清,我正在控制域 A 上的服务器和内容,这需要允许域 B 加载它的内容......

另外,我在我的 Safari 日志中发现了这个错误:

Refused to display document because display forbidden by X-Frame-Options.

我正在使用 Rails 4、Apache2。

【问题讨论】:

    标签: ruby-on-rails apache iframe apache2 cross-domain


    【解决方案1】:

    我必须在我的 Rails 应用程序配置中添加以下行:

    config.action_dispatch.default_headers['X-Frame-Options'] = "GOFORIT"

    【讨论】:

      猜你喜欢
      • 2011-11-11
      • 1970-01-01
      • 1970-01-01
      • 2020-08-03
      • 1970-01-01
      • 2012-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多