Open jshumaker opened 6 years ago
Thanks for reporting. I'll try to fix it during upcoming weekend.
Thanks, I'm fairly new to Grafana, but might see if I can figure out a fix on Friday.
@jshumaker I suspect that the issue might be in this function: https://github.com/anryko/grafana-influx-dashboard/blob/master/getdash.app.js#L721-L771. This is the only place where urls are constructed. If you would like to fix it, that would be the place to start debugging.
For apache with mod_proxy and mod_proxy_html :
ProxyPreserveHost On
ProxyPass /subpath/metrics/ http://grafana-backend.example.com:3000/
ProxyHTMLURLMap http://grafana-backend.example.com:3000/ /subpath/metrics/
<Location /subpath/metrics/api>
Header Set Pragma "no-cache"
Header Set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
Header Set Cache-Control "max-age=0, no-store, no-cache, must-revalidate"
Header Unset ETag
FileETag None
ProxyPassReverse http://grafana-backend.example.com:3000/api
ProxyHTMLURLMap http://grafana-backend.example.com:3000/api /subpath/metrics/api
RequestHeader unset Accept-Encoding
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
</Location>
<Location /subpath/metrics>
ProxyPassReverse http://grafana-backend.example.com:3000
ProxyHTMLURLMap http://grafana-backend.example.com:3000 /subpath/metrics
RequestHeader unset Accept-Encoding
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
</Location>
If Grafana is behind a reverse proxy with a subpath, then getdash.js fails as it eventually starts querying without the subpath. In window.grafanaBootData I can see it has the sub-path in most locations, but not for the settings.datasources.*.url which all start with /api/