上周 Grafana 工作沒有任何問題杰捂,但更新到 8.3.5 后我無法再登錄红符。
在登錄屏幕中赞弥,輸入我的用戶名和密碼后,會(huì)出現(xiàn)一條消息:“Origin not allowed”阵漏。 在 grafana.log 文件中,我看到一行:
lvl=eror msg="無法根據(jù) cookie 查找用戶" logger=context error="未找到用戶令牌"
解決方案:
在nginx的conf.d文件中翻具,有一個(gè)grafana.conf的文件履怯,需要在配置文件中增加
proxy_set_header Host $http_host; //added after upgrade from 8.1 to 8.4.1 for origin not allowed error
但是發(fā)現(xiàn)還是不行,看到說可以把$http_host改成自己的domain裆泳,于是嘗試下
proxy_set_header Host domain.com
最后重啟nginx
sudo systemctl restart nginx
sudo systemctl status nginx
然后刷新頁面叹洲,登錄,可以進(jìn)去了