I am using Nginx to serve both graphite and grafana (they are all running on the same server - not my desktop). I am able to access graphite via Nginx. However, grafana cannot seem to connect to graphite (error: Graphite HTTP Request Error). I have copied the nginx config below for grafana - any ideas on fixing this will be appreciated. The request URL that fails in the browser is this (accessible if I access it directly in the browser):
**http://xxx.xxx.xxx.xxx:8080/render**
Nginx default
server {
listen 85; ##listen [::]:85; #ipv6only=on;
server_name grafana;
root /home/xxxx/grafana-1.5.3/;
index index.html index.htm;
##logging per server
access_log /var/log/nginx/grafana/access.log;
error_log /var/log/nginx/grafana/error.log;
location / {
## root /home/xxxx/grafana-1.5.3/;
}
}
config.js URL for graphite (in grafana)
graphiteUrl: "http://xxx.xxx.xxx.xxx:8080"
Edit Graphite does not need authentication for access from grafana. Also, I am using grafana v1.5.3
Try to access graphite through nginx (same origin). Just add new location
location /render {
proxy_pass http://xxx.xxx.xxx.xxx:8080/render;
}
then in your grafana config file change graphite url
I was able to solve this problem by changing the requests to GET instead of POST. See this issue for more information. https://github.com/grafana/grafana/issues/345
My data sources ended up looking like
datasources: {
graphite: {
type: 'graphite',
url: window.location.protocol+"//"+window.location.hostname+":"+window.location.port+"/_graphite",
default: true,
render_method: 'GET'
},
},
I still haven't figured out how to get my graphite install to accept POST requests. Even when querying directly so I can be sure CORS isn't an issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With