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