问题原文
原帖链接 · AXE Labs · CC BY-SA 3.0
I've setup and started default grafana and it works as expected on http://localhost:3000. I'm trying to proxy it with nginx where I have ssl installed. I'm trying to have it respond to https://localhost/grafana but it just serves the following:
{{alert.title}}
I have this in my nginx server block:
location /grafana {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
}
社区高分解答
原帖链接 · AXE Labs · CC BY-SA 3.0
It seems nginx supports rewriting the requests to the proxied server so updating the config to this made it work:
location /grafana {
proxy_pass http://localhost:3000;
rewrite ^/grafana/(.*) /$1 break;
proxy_set_header Host $host;
}
My grafana.ini also has an updated root:
[server]
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
