Search code examples
cross-domaingraphitedescartes

No 'Access-Control-Allow-Origin' header is present on the requested resource, graphite/descartes environment


Has anyone got this error? There's a workaround in https:// github. com/obfuscurity/descartes editing the http.conf (apache webserver) and adding the following:

Header set Access-Control-Allow-Origin "ip"
Header set Access-Control-Allow-Methods "GET, OPTIONS"
Header set Access-Control-Allow-Headers "origin, authorization, accept"
Header set Access-Control-Allow-Credentials true

This method works perfectly but it affects any connection/request made to our webserver.

As I coud see in graphite, instead of editing the http.conf, we could modify the /opt/graphite/ webapp/graphite/local_settings.py and add

ALLOWED_HOSTS = "your_descartes_url. domain".

But this last doesn't work for me. So, do you know any other graphite side config to try out?


Solution

  • The issue, as you figured out, is at the web-server level, and the request doesn't even reach the webapp.