nginx反向代理Grafana
2024-10-12 12:23:06
官方文旦地址: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
最新文章
- Scalaz(22)- 泛函编程思维: Coerce Monadic Thinking
- 接入多家ERP厂商,美团点评餐饮高速路开启
- BZOJ-4010 菜肴制作 贪心+堆+(拓扑图拓扑序)
- JAVA基础知识之网络编程——-基于AIO的异步Socket通信
- Ibatis 异常:Unable to open connection to ";oledb , provider V2.0.0.0 in framework .NET V2.0";.
- Centos5.5内核升级
- 关于封装unity3d的dll时候的进一步总结
- 记录一次Session偶尔获取不到的解决过程
- 前端之 HTML🎃
- class not found: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
- IPFS: NAT traversal(NAT穿越)
- 原创《weex面向未来的架构》
- java调用天气预报接口案例
- css把容器级别(div...)标签固定在一个位置(在页面最右边)
- zabbix 应用监控作业笔记 ansible-playbook
- netty源码解解析(4.0)-4 线程模型-概览
- 插入排序的C、C++实现
- CentosMySQL5.6安装方法
- 微信公众号H5支付
- LeetCode——Pascal's Triangle II
热门文章
- 论文阅读 Inductive Representation Learning on Temporal Graphs
- centos7 netstat command not found
- SimpleMongoDbFactory类已经失效,被SimpleMongoClientDbFactory替代
- 全网最新的nacos 2.1.0集群多节点部署教程
- 了解有哪几个C标准&了解C编译管道
- Druid 查询超时配置的探究 → DataSource 和 JdbcTemplate 的 queryTimeout 到底谁生效?
- python迭代器、生成器、yield理解
- python os相关操作
- k8s驱逐篇(2)-kubelet节点压力驱逐
- 《吐血整理》进阶系列教程-拿捏Fiddler抓包教程(13)-Fiddler请求和响应断点调试