Ghost: API Access-Control-Allow-Origin (CORS)

Created on 27 Apr 2017  Â·  2Comments  Â·  Source: TryGhost/Ghost

Hello,
I have two domains that relate to my blog, "mydomain.com" and "mydomain.it" APIs enabled in the panel work only on main domain (mydomain.com).

If I connect through the second domain (mydomain.it) APIs do not work, I find the following error in console:

XMLHttpRequest cannot load https://mydomain.com/ghost/api/v0.1/posts/?limit=all&include=tags&filter=(pa…3Atrue%2Cpage%3Afalse)&client_id=ghost-frontend&client_secret=***********. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://mydomain.it' is therefore not allowed access.

I tried to add to nginx this header, but the problem does not change "add_header Access-Control-Allow-Origin *;"

Most helpful comment

@kevinansfield may I suggest adding the word CORS to the tittle; since when I searched for the query "CORS" in the documentation and found nothing, it confused me a bit......

All 2 comments

Hey @ubuntutest 👋 Sorry to hear you are having problems with your CORS headers 😞 but I'm going to close this issue as we don't offer support here on Github - it's used solely for bug tracking and on-going development.

Please head over to our Slack channel where the community can better help with these sorts of things. Also, check the API docs for using the public API from an external domain, it might have some pointers for what's wrong or at least help guide your questions in Slack 😄http://api.ghost.org/docs/ajax-calls-from-an-external-website

@kevinansfield may I suggest adding the word CORS to the tittle; since when I searched for the query "CORS" in the documentation and found nothing, it confused me a bit......

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kirrg001 picture kirrg001  Â·  3Comments

hjzheng picture hjzheng  Â·  4Comments

shadowbottle picture shadowbottle  Â·  3Comments

jliikala picture jliikala  Â·  3Comments

mattferderer picture mattferderer  Â·  4Comments