当我尝试访问InfluxDB管理UI或通过Graphana时收到以下错误:
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.
请注意,只有当我尝试通过Internet连接时才会出现此错误,当我转到服务器本地网络并将上述公共IP更改为本地IP时,一切正常 .
现在我明白什么是跨域错误和CORS,我也得到了我需要启用CORS,因为在InfluxDB服务器中出现错误,点是我不知道该怎么做 .
InfluxDB位于AWS上的Ubuntu服务器14.something上 .
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