From 117ecf040319854f4570855b030e2de9b73f35da Mon Sep 17 00:00:00 2001 From: Santiago Date: Tue, 12 Dec 2023 16:52:50 +0100 Subject: [PATCH] Alerting: Fix auth for Nginx in Mimir Backend block (devenv) (#79404) --- .../docker/blocks/mimir_backend/nginx/nginx.conf.template | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/devenv/docker/blocks/mimir_backend/nginx/nginx.conf.template b/devenv/docker/blocks/mimir_backend/nginx/nginx.conf.template index ba112545643..7ce374a378e 100644 --- a/devenv/docker/blocks/mimir_backend/nginx/nginx.conf.template +++ b/devenv/docker/blocks/mimir_backend/nginx/nginx.conf.template @@ -5,9 +5,15 @@ events {} http { resolver 127.0.0.11 ipv6=off; + # Use basic auth user in `X-Scope-OrgID` if the header is not already set. + map $http_x_scope_orgid $add_x_scope_orgid { + default $http_x_scope_orgid; + "" $remote_user; + } + server { listen 8080; - proxy_set_header X-Scope-OrgID $http_x_scope_orgid; + proxy_set_header X-Scope-OrgID $add_x_scope_orgid; location / { auth_basic "Mimir Backend";