2014-12-19 46 views
2

我收到以下错误,当我尝试访问InfluxDB管理界面或通过Graphana:InfluxDB&Grafana跨域错误

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://54.zzz.xx.yyy:8086/cluster_admins/authenticate?u=abc&p=dec. This can be fixed by moving the resource to the same domain or enabling CORS. 

注意,只有当我尝试通过互联网连接,我得到这个错误,当我去服务器本地网络,并将上述公共IP更改为本地IP,一切正常。

现在我明白什么是跨域错误和CORS,我也得到了我需要启用CORS,因为InfluxDB服务器中的错误说,点是我不知道该怎么做。

InfluxDB位于Ubuntu服务器上14.something on AWS。

回答

1

由于没有人回答,我诉诸了我的备份选项,使用IIS作为代理,它在内部从本地Intranet读取,从而避免了跨域错误。

详情在:http://www.iis.net/learn/extensions/configuring-application-request-routing-(arr)/creating-a-forward-proxy-using-application-request-routing

您可以使用Apache或具有URL重写功能的任何其他Web服务器,在我来说,我使用IIS。

编辑: 原来的硬编码为现在和将在以后进行更改:https://github.com/influxdb/influxdb/issues/1244#issuecomment-68219522