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
commitbc5ff45dbb4d0a0e4244f1de5bf2dcf09507205e (patch)
tree6720cbfde0bd72aa2277dd3718c88ce4dc754919
parent342318d01ef57e06cc56a4486d6a306a19a0185e (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]