From: Redouane Kachach Date: Tue, 1 Oct 2024 08:38:39 +0000 (+0200) Subject: mgr/cephadm: move Grafana's subpath handling logic to grafana config X-Git-Tag: testing/wip-pdonnell-testing-20241019.005706-debug~32^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e80b7ba4add2d698555112e0ec46328cab703688;p=ceph-ci.git mgr/cephadm: move Grafana's subpath handling logic to grafana config 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 --- diff --git a/src/pybind/mgr/cephadm/templates/services/grafana/grafana.ini.j2 b/src/pybind/mgr/cephadm/templates/services/grafana/grafana.ini.j2 index 972ef22e7b5..967f1355af1 100644 --- a/src/pybind/mgr/cephadm/templates/services/grafana/grafana.ini.j2 +++ b/src/pybind/mgr/cephadm/templates/services/grafana/grafana.ini.j2 @@ -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 diff --git a/src/pybind/mgr/cephadm/templates/services/mgmt-gateway/external_server.conf.j2 b/src/pybind/mgr/cephadm/templates/services/mgmt-gateway/external_server.conf.j2 index 260e7418e2d..b830034a7d4 100644 --- a/src/pybind/mgr/cephadm/templates/services/mgmt-gateway/external_server.conf.j2 +++ b/src/pybind/mgr/cephadm/templates/services/mgmt-gateway/external_server.conf.j2 @@ -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