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>
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
{% 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