【问题标题】:Why cannot access static files of grafana service?为什么不能访问grafana服务的静态文件?
【发布时间】:2019-03-01 08:16:12
【问题描述】:

我使用官方 docker 按照文档 running grafana behind proxyinstalling grafana using docker 启动 Grafana,并使用命令:

docker run -itd -p 3000:3000 \
--name=grafana \
-v ~/grafana_storage:/var/lib/grafana \
-e "GF_SERVER_DOMAIN=www.jijunxu.cn" \
-e "GF_SERVER_ROOT_URL=https://www.jijunxu.cn/grafana/" \
--rm grafana/grafana

和 nginx.conf:

location /grafana/
{
    proxy_pass http://localhost:3000/;
}

但我在访问https://www.jijunxu.cn/grafana/ 时得到了这个页面:

If you're seeing this Grafana has failed to load its application files 

1. This could be caused by your reverse proxy settings.

2. If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath

3. If you have a local dev build make sure you build frontend using: npm run dev, npm run watch, or npm run build

4. Sometimes restarting grafana-server can help

以及 CSS 和 JS 文件上的 404。我已经尝试了所有这些方法,但它仍然是一样的。那么我的 nginx.conf 或 docker 命令有什么问题吗?

【问题讨论】:

    标签: docker web nginx grafana


    【解决方案1】:

    我认为应该将环境变量GF_SERVER_DOMAIN 设置为其默认值localhost,因为它托管在容器内,而不是您的机器上。

    也就是说,删除 -e "GF_SERVER_DOMAIN=www.jijunxu.cn" 应该可以工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-20
      • 2023-04-05
      • 2020-09-04
      • 2019-08-09
      • 2019-12-26
      • 1970-01-01
      • 1970-01-01
      • 2011-01-18
      相关资源
      最近更新 更多