0

While trying to setup grafana with graphite using nginx server. I am getting this error: No 'Access-Control-Allow-Origin' header is present on the requested resource. I tried changing configuration file but still not working my grafana configuration file:

#Grafana Server Configuration
server {
  listen 9400;

  access_log /var/log/nginx/grafana.access.log;
  error_log  /var/log/nginx/grafana.error.log;

  location / {
    add_header Access-Control-Allow-Origin "ip address of the server";
    add_header  "Access-Control-Allow-Credentials" "true";
    add_header  "Access-Control-Allow-Methods" "GET, OPTIONS";
    add_header  "Access-Control-Allow-Headers" "Authorization, origin, accept";
    root /usr/share/grafana;
  }
}
0

You need to add full URL to the Access-Control-Allow-Origin header, like:

add_header Access-Control-Allow-Origin "http://example.com";
  • I did that but still not working – user3457261 Feb 3 '15 at 12:01
  • You used the actual domain name that is including the resource in its code? – Tero Kilkanen Feb 3 '15 at 12:08
  • I gave like this "ipaddesss:8080" – user3457261 Feb 3 '15 at 12:13
  • And you are accessing the page with http://ip_address:8080/ in your browser? – Tero Kilkanen Feb 3 '15 at 12:15
  • Yes I am able to access that link – user3457261 Feb 3 '15 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.