diff --git a/scripts/helmcharts/openreplay/charts/assist/templates/ingress.yaml b/scripts/helmcharts/openreplay/charts/assist/templates/ingress.yaml index 60bdcbe38..e553d8d70 100644 --- a/scripts/helmcharts/openreplay/charts/assist/templates/ingress.yaml +++ b/scripts/helmcharts/openreplay/charts/assist/templates/ingress.yaml @@ -10,7 +10,15 @@ metadata: {{- include "assist.labels" . | nindent 4 }} annotations: nginx.ingress.kubernetes.io/rewrite-target: /$1 - nginx.ingress.kubernetes.io/upstream-hash-by: $http_x_forwarded_for + nginx.ingress.kubernetes.io/configuration-snippet: | + # Extract sessionID from peerId using regex + if ($arg_peerId ~ ".*-(?[^-]+)-.*") { + set $session_id $extracted_sid; + } + add_header X-Debug-Session-ID $session_id; + add_header X-Debug-Session-Type "wss"; + nginx.ingress.kubernetes.io/upstream-hash-by: $session_id + {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} {{- end }}