2013-11-21 51 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

相關問題