2014-12-19 132 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