summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-06-19 00:27:12 +0200
committerAhmed Abdelhalim <[email protected]>2026-06-19 00:27:12 +0200
commit1b89be4aab4cf0787b4ef70e8b2e2bb91769cb67 (patch)
tree6720cbfde0bd72aa2277dd3718c88ce4dc754919
parent5b8751cd381dc593be6b9ba5fe35138522e81f5e (diff)
Be explicit about root URL when using proxies
-rw-r--r--roles/grafana/templates/grafana.ini.j26
1 files changed, 6 insertions, 0 deletions
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]