From bc5ff45dbb4d0a0e4244f1de5bf2dcf09507205e Mon Sep 17 00:00:00 2001 From: Ahmed AbdelHalim Date: Fri, 19 Jun 2026 00:27:12 +0200 Subject: Be explicit about root URL when using proxies --- roles/grafana/templates/grafana.ini.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/grafana/templates/grafana.ini.j2 b/roles/grafana/templates/grafana.ini.j2 index 05166994..54672dea 100644 --- a/roles/grafana/templates/grafana.ini.j2 +++ b/roles/grafana/templates/grafana.ini.j2 @@ -1,7 +1,13 @@ [server] http_port = {{ grafana_port }} {% if grafana_hostname | length > 0 %} + {% if proxy_type == "caddy" %} +root_url = https://{{ grafana_hostname }}/ + {% elif proxy_type == "nginx" %} root_url = http://{{ grafana_hostname }}/ + {% else %} +root_url = http://localhost:{{ grafana_port }}/ + {% endif %} {% endif %} [database] -- cgit v1.2.3