【问题标题】:Allowing http content inside https site [duplicate]允许 https 站点内的 http 内容 [重复]
【发布时间】:2018-01-26 04:13:44
【问题描述】:

我有使用 https 托管的项目,我想在 iframe 中显示 http 内容。但我的问题是当我在 http 中加载网站时,页面上没有显示任何内容接受警告“该页面正在尝试从未经身份验证的来源加载脚本”。

<iframe id="demoSite" src="{{$product->demo_url}}" frameborder="0" width="100%" height="100%">
</iframe>

许多人会认为这是一个公认的答案。但在 2018 年,它并没有给你正确的答案。如果您有疑问,请参阅帖子下方的 cmets。 How to allow http content within an iframe on a https site

所以任何人都有解决方案,请帮助我解决它。谢谢

【问题讨论】:

  • 简答:你不能。

标签: php laravel iframe laravel-5


【解决方案1】:

正如乔所说,你不能。

还有really good reasons。如果您通过自己的安全服务器代理请求,我仍然相信您可以做到。

我不建议这样做,但理论上,您可以创建一个服务来通过“安全”连接来提供不安全的内容:

https://example.com/proxy-the-iframe?unsafe-url=http://yourunsafecontenthere.com

不过,这只是将不安全的内容带入您的网站。

最好的选择是:不要在 https 中使用 http,或者使用 http 并接受 iframe 的不安全来源。

【讨论】:

  • 代理服务器会有帮助吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-10-26
  • 1970-01-01
  • 1970-01-01
  • 2015-03-22
  • 1970-01-01
  • 2015-02-26
  • 2015-12-12
相关资源
最近更新 更多