Multi-tenant deployment via helm using basic-auth

I can’t seem to get mult-tenant working doing a user / tenant id map in nginx using helm.

This is my gateway section for values.yaml being passed to the helm chart doing the install in openshift.

values.yaml
gateway:

  service:

    type: ClusterIP

  basicAuth:

    enabled: true

    existingSecret: loki-basic-auth

  nginxConfig:

    httpSnippet: |

      map $remote_user $loki_org_id {

        user1 tenant1;

        user2 tenant2;

      }

      proxy_set_header X-Scope-OrgID $loki_org_id;

The auth is working, but the response i’m getting is no org id when I try to curl /loki/api/v1/labels

I want to say the issue is around the proxy_set_header not taking precedence for the location blocks in the nginx.conf, but not sure how to resolve this.

chart: loki-6.46.0

app version: 3.5.7

nvm, I figured it out. After finding this bug Helm: Multi-tenant support is broken due to changes in Gateway configuration · Issue #18003 · grafana/loki · GitHub

I moved the proxy_set_header to locationSnippet