]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: move Grafana's subpath handling logic to grafana config
authorRedouane Kachach <rkachach@ibm.com>
Tue, 1 Oct 2024 08:38:39 +0000 (10:38 +0200)
committerRedouane Kachach <rkachach@ibm.com>
Thu, 10 Oct 2024 14:44:38 +0000 (16:44 +0200)
Fixes: https://tracker.ceph.com/issues/68315
So far, Grafana's subpath handling has been managed on the Nginx
server side using a rewrite rule. Let's move this logic to the Grafana
side to make it consistent with the rest of the monitoring services.

Signed-off-by: Redouane Kachach <rkachach@ibm.com>
src/pybind/mgr/cephadm/templates/services/grafana/grafana.ini.j2
src/pybind/mgr/cephadm/templates/services/mgmt-gateway/external_server.conf.j2

index 972ef22e7b58e9afddf13c191f8c379701eca125..967f1355af14bc8ac1f1cb351b30fbf0f769a46a 100644 (file)
@@ -15,7 +15,8 @@
   http_port = {{ http_port }}
   http_addr = {{ http_addr }}
 {% if mgmt_gw_enabled %}
-  root_url = %(protocol)s://%(domain)s/grafana/
+  root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/
+  serve_from_sub_path = true
 {% endif %}
 [snapshots]
   external_enabled = false
index 260e7418e2d7fa295b73f4b83e5e8e0c6ad37671..b830034a7d4e9e490be25358594ac50c7db926d5 100644 (file)
@@ -109,7 +109,6 @@ server {
 
 {% if grafana_endpoints %}
     location /grafana {
-        rewrite ^/grafana/(.*) /$1 break;
         proxy_pass {{ grafana_scheme }}://grafana_servers;
         # clear any Authorization header as Prometheus and Alertmanager are using basic-auth browser
         # will send this header if Grafana is running on the same node as one of those services