nginx反向代理grafana+prometheus

1.nginx配置文件

location /prometheus{   
        proxy_pass http://localhost:9090;

}
location /grafana {
        rewrite ^/grafana/(.*) /$1 break;
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
}

2.修改grafana配置文件

vim /etc/grafana/grafama.ini
[server]
# Protocol (http, https, h2, socket)
;protocol = http
root_url: http://localhost:3000/grafana/
3.重启nginx、grafana
4.访问nginx http://ip:80/grafana
posted @ 2021-08-09 22:45  真赤鸡  阅读(525)  评论(0)    收藏  举报