From 1b89be4aab4cf0787b4ef70e8b2e2bb91769cb67 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(+) (limited to 'roles/grafana') 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