官方文旦地址:https://grafana.com/tutorials/run-grafana-behind-a-proxy/

一级路径

只需要修改nginx配置文件

# this is required to proxy Grafana Live WebSocket connections.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
} server {
listen 80;
root /usr/share/nginx/html;
index index.html index.htm; location / {
proxy_pass http://localhost:3000/;
} # Proxy Grafana Live WebSocket connections.
location /api/live {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_pass http://localhost:3000/;
}
}

二级路径

除了修改nginx配置文件外,还需要修改grafana配置文件

# this is required to proxy Grafana Live WebSocket connections.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
} server {
listen 80;
root /usr/share/nginx/www;
index index.html index.htm; location ^~ /grafana/ {
proxy_pass http://localhost:3000/;
} # Proxy Grafana Live WebSocket connections.
location ^~ /grafana/api/live {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_pass http://localhost:3000/;
}
}

修改grafana.ini配置文件

# vim /etc/grafana/grafana.ini
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana
serve_from_sub_path = true # systemctl restart grafana-server

最新文章

  1. Scalaz(22)- 泛函编程思维: Coerce Monadic Thinking
  2. 接入多家ERP厂商,美团点评餐饮高速路开启
  3. BZOJ-4010 菜肴制作 贪心+堆+(拓扑图拓扑序)
  4. JAVA基础知识之网络编程——-基于AIO的异步Socket通信
  5. Ibatis 异常:Unable to open connection to "oledb , provider V2.0.0.0 in framework .NET V2.0".
  6. Centos5.5内核升级
  7. 关于封装unity3d的dll时候的进一步总结
  8. 记录一次Session偶尔获取不到的解决过程
  9. 前端之 HTML🎃
  10. class not found: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
  11. IPFS: NAT traversal(NAT穿越)
  12. 原创《weex面向未来的架构》
  13. java调用天气预报接口案例
  14. css把容器级别(div...)标签固定在一个位置(在页面最右边)
  15. zabbix 应用监控作业笔记 ansible-playbook
  16. netty源码解解析(4.0)-4 线程模型-概览
  17. 插入排序的C、C++实现
  18. CentosMySQL5.6安装方法
  19. 微信公众号H5支付
  20. LeetCode——Pascal's Triangle II

热门文章

  1. 论文阅读 Inductive Representation Learning on Temporal Graphs
  2. centos7 netstat command not found
  3. SimpleMongoDbFactory类已经失效,被SimpleMongoClientDbFactory替代
  4. 全网最新的nacos 2.1.0集群多节点部署教程
  5. 了解有哪几个C标准&了解C编译管道
  6. Druid 查询超时配置的探究 → DataSource 和 JdbcTemplate 的 queryTimeout 到底谁生效?
  7. python迭代器、生成器、yield理解
  8. python os相关操作
  9. k8s驱逐篇(2)-kubelet节点压力驱逐
  10. 《吐血整理》进阶系列教程-拿捏Fiddler抓包教程(13)-Fiddler请求和响应断点调试