2013-11-21 52 views
0

我正在使用Nginx与清漆FPC。NginX + Varnish + Iframe =权限被拒绝访问属性'文档'

NginX vHost正在运行我的站点上的端口8080和Varnish运行在端口80

所以,如果我去http://mydomain.com清漆捕获请求和抓取内容从http://mydomian.com:8080

说了这么多,让我们说我在我的网站具有以下HTML有page.html

<iframe src="http://mydomain.com/another_page.php" frameborder="0" height="100" marginheight="0" marginwidth="0" scrolling="auto" width="100%" id="iframe" onload="autoResizeIFrame();" seamless></iframe> 
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script> 
<script type="text/javascript"> 
var $j = jQuery.noConflict(); 
function autoResizeIFrame() { 
    $j('#iframe').height($j('#iframe').contents().find('html').height()); 
} 
</script> 

所以,当我访问该页面在http://mydomain.com/page.html,它的意思是加载iframe和iframe的负载时它会使用jQuery重新设置iframe的高度。

由于相同政策,这对NginX + Varnish不起作用。

这是我在Firefox中出现错误: enter image description here

我也试图在iframe的src设置为http://mydomain.com:8080/another_page.php - 但这并没有帮助。

出了什么问题?我该如何解决这个问题?

回答

0

尝试增加

add_header Access-Control-Allow-Origin *; 

到服务器的nginx的conf下的位置段

+0

我想它(http://pastebin.com/raw.php?i=r0gNgpZM)并重新启动nginx的并没有帮助/工作。 – Latheesan

相关问题