nginx - 由于静态文件加载失败,无法从浏览器访问 grafana
问题描述
我想从我的浏览器访问 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: yarn start, yarn start:hot, or yarn build
4. Sometimes restarting grafana-server can help
grafana
我尝试解决一些问题并在's 设置中添加了域名。根据文档,我的 NGINX 非常完美。事实上,一切都运行良好。问题出在匿名会话中,即如果我尝试在无用户模式下加载它,它不会加载。在登录模式下,它会加载但没有我创建的所有仪表板。
我的 NGINX 配置如下:
proxy_cache_path /var/nginx/cache levels=1:2 keys_zone=grafana_cache:10m max_size=20g
inactive=60m use_temp_path=off;
server {
server_name foo.bar www.foo.bar;
location / {
proxy_cache grafana_cache;
proxy_pass http://127.0.0.1:3000;
include /etc/nginx/proxy_params;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/foo.bar/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/foo.bar/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.foo.bar) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = foo.bar) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name foo.bar www.foo.bar;
return 404; # managed by Certbot
}
我希望grafana
仪表板在用户登录和不登录的情况下都能正常工作。
解决方案
我将我的hash_bucket_size
设置删除为 64nginx.conf
并使其正常工作。
推荐阅读
- java - Android PayUMoney、Link PayTM、PhonePe、GooglePay 或重定向到各自的应用程序而不是应用程序内
- sql-server-data-tools - SSDT 模式比较改变序列
- python - Matplotlib,列表中的点动画
- java - 带有泛型的未知 Javadoc 标记类型
- html - 用大型设备中的图像填补 bootstrap 3 网格系统的空白
- symfony - sonata_type_model 未更新数据,sonata_type 集合不够具体(oneToMany 关系)
- sql - 如何在opendistro sql中以毫秒格式检索日期
- regex - 需要自定义 vim 命令的帮助
- json - 超过 500mb 的 Json 数据在 Angular js 服务中没有得到响应
- angularjs - safari 上的材质按钮