从https父窗口中的iframe访问HTTP

从https父窗口中的iframe访问HTTP

本文介绍了从https父窗口中的iframe访问HTTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图解决这是造成其在iframe中加载不安全内容的SSL问题。我有同样的托管服务器上的两个域地址。我有SSL只为一个域。当我在第一个网站,使用SSL我访问那些没有SSL第二个站点。我想找到一种方法,如果能够解决这个问题。此外,这两个网站都托管在同一服务器上。

I'm trying to solve a SSL issue which is caused by insecure content which is loaded within iframe. I have two domain addresses hosted on same server. I have SSL only for one domain. And when I'm on first site which use SSL I'm accessing second site which have no SSL. I want to find a way to solve this issue if possible. Again, both sites are hosted on same server.

请给我建议或完全解答如何解决这个问题呢?

Please give me suggestions or full answers how to solve this problem ?

我本人来说想使用htaccess的,但我不知道的不多。我想以某种方式来映射第一个网站网址进行第二个站点,例如:

I'm personaly thinking to use htaccess, but i dont know much about it. I want somehow to map the first site special url to second site, for example:

<iframe src="https://site1.com/special-url-to-point-to-site2">

,然后用的.htaccess映射到SITE2,所以没有什么坏了,一切运作良好。我不知道这是可能的,我希望有人明白我的意思,并可以提供帮助。

and then with .htaccess to map to site2, so nothing is broken and everything works good.I'm not sure if this is possible, I hope somebody understand what i mean and can help.

推荐答案

见的指令。你不能把它用在htaccess的文件,但你的可以的使用 P 标记中的mod_rewrite只要mod_proxy模块被加载。是这样的:

See the ProxyPass directive. You can't use it in the htaccess file but you can use the P flag in mod_rewrite as long as mod_proxy is loaded. Something like:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^site1\.com$ [NC]
RewriteRule ^special-url-to-point-to-site2$ http://site2.com/special-url-to-point-to-site2 [L,P]

在你的服务器/虚拟主机的配置(对site1.com),您可以使用代理通:

In your server/vhost config (for site1.com) you can use proxy pass:

ProxyPass special-url-to-point-to-site2 http://site2.com/special-url-to-point-to-site2

确认签 ProxyPassReverse 其中调整URL的响应标头回指向站点1。

Make sure to checkout ProxyPassReverse which adjusts the url's in response headers to point them back to site1.

这篇关于从https父窗口中的iframe访问HTTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 23:31