2017-10-16 7 views
0

기본 bitnami wordpress 설치가 있습니다. 나는 그들의 가이드와 설정 https 및 https 리디렉션에 자동 HTTP를 따랐다.아파치가 http에서 https로 Access-Control-Allow-Origin을 설정했습니다.

그러나 나는 다음과 같은 오류가 외부 스크립트를로드하려고 할 때 :

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 Engineer입니다.

워드 프레스에서 CORS를 사용하도록 설정해야합니다. 그것을 달성하기 위해, 당신은 그 후 installdir/apps/wordpress/conf/httpd-app.conf 파일

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

이 라인을 설정해야합니다, 당신은이 구성을로드하기 위해 아파치 서버를 다시 시작해야합니다.

installdir/ctlscript.sh restart apache 

our documentation guide에 따라 CORS를 사용 설정하는 다른 방법이 있습니다.

감사합니다,

+0

예, CORS가 갈 수있는 방법은 참으로 Jota. 행운을 빕니다! – Siyah