上周 Grafana 工作沒有任何問題,但更新到 8.3.5 后我無法再登錄。
在登錄屏幕中,輸入我的用戶名和密碼后,會出現(xiàn)一條消息:“Origin not allowed”。 在 grafana.log 文件中,我看到一行:
lvl=eror msg="無法根據(jù) cookie 查找用戶" logger=context error="未找到用戶令牌"
解決方案:
在nginx的conf.d文件中,有一個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
然后刷新頁面,登錄,可以進去了