2017-10-16 86 views
0

我有一個基本的bitnami wordpress安裝。我遵循他們的指導並設置了https和自動http來https重定向。Apache設置訪問控制允許來源http從https到https

然而,當我試圖加載外部腳本,我得到以下錯誤:

Failed to load https://external-script.com/: The 'Access-Control-Allow-Origin' 
header has a value 'http://my-site.io' that is not equal to the supplied origin. 
Origin 'https://my-site.io' is therefore not allowed access. 

我應該修改哪個文件,我應該補充的嗎? 謝謝

回答

2

Bitnami工程師在這裏。

您需要在WordPress中啓用CORS。爲了實現這一目標,你將需要設置該線路installdir/apps/wordpress/conf/httpd-app.conf文件

... 
<Directory /opt/bitnami/apps/wordpress/htdocs/> 
... 
Header set Access-Control-Allow-Origin "*" 
... 
</Directory> 

之後,您將需要重新啓動Apache服務器加載此配置。

installdir/ctlscript.sh restart apache 

您還可以通過關注our documentation guide找到啓用CORS的不同方式。

Regards, Jota

+0

是的,CORS的確是要走的路。祝你好運! – Siyah

相關問題