From ce3e88932d1298f1f2b2e5206f4facd5682dbc24 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 12 Aug 2022 13:10:36 -0500 Subject: [PATCH] vmalert: Allow configuring http.pathPrefix *vmalert* requires explicit configuration when it is behind a reverse proxy. --- group_vars/metricspi/vmalert.yml | 1 + roles/vmalert/templates/vmalert.sysconfig.j2 | 3 +++ 2 files changed, 4 insertions(+) diff --git a/group_vars/metricspi/vmalert.yml b/group_vars/metricspi/vmalert.yml index 519b3dc..29a6966 100644 --- a/group_vars/metricspi/vmalert.yml +++ b/group_vars/metricspi/vmalert.yml @@ -7,3 +7,4 @@ vmalert_external_alert_source: >- {% raw -%} explore?orgId=1&left=%5B"now-1h","now","metrics",%7B"expr":"{{$expr|queryEscape}}"%7D%5D {%- endraw %} +vmalert_http_path_prefix: /vmalert/ diff --git a/roles/vmalert/templates/vmalert.sysconfig.j2 b/roles/vmalert/templates/vmalert.sysconfig.j2 index 06a31be..13740e2 100644 --- a/roles/vmalert/templates/vmalert.sysconfig.j2 +++ b/roles/vmalert/templates/vmalert.sysconfig.j2 @@ -16,3 +16,6 @@ external_url={{ vmalert_external_url }} {% if vmalert_external_alert_source|d %} external_alert_source={{ vmalert_external_alert_source }} {% endif %} +{% if vmalert_http_path_prefix|d %} +http_pathPrefix={{ vmalert_http_path_prefix }} +{% endif %}