From b0efe80f05e63e81847e486abb22ce992a5f5434 Mon Sep 17 00:00:00 2001 From: Nicolas Duchon Date: Tue, 26 Nov 2024 01:06:51 +0100 Subject: [PATCH] fix: debug endpoint formatting --- nginx.tmpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nginx.tmpl b/nginx.tmpl index 9d7c13f..a15e7e8 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -367,16 +367,16 @@ upstream {{ $vpath.upstream }} { {{- define "debug_location" }} {{- $debug_paths := dict }} {{- range $path, $vpath := .VHost.paths }} - {{- $tmp_port := dict }} + {{- $tmp_ports := dict }} {{- range $port, $containers := $vpath.ports }} {{- $tmp_containers := list }} {{- range $container := $containers }} {{- $tmp_containers = dict "Name" $container.Name | append $tmp_containers }} {{- end }} - {{- $_ := dict $port $tmp_containers | set $tmp_port "ports" }} - {{- $tmp_port = deepCopy $vpath | merge $tmp_port }} + {{- $_ := set $tmp_ports $port $tmp_containers }} {{- end }} - {{- $_ := set $debug_paths $path $tmp_port }} + {{- $debug_vpath := deepCopy $vpath | merge (dict "ports" $tmp_ports) }} + {{- $_ := set $debug_paths $path $debug_vpath }} {{- end }} {{- $debug_vhost := deepCopy .VHost }} @@ -409,7 +409,7 @@ upstream {{ $vpath.upstream }} { location /nginx-proxy-debug { default_type application/json; - return 200 '{{ toJson $debug_response }}'; + return 200 '{{ toJson $debug_response }}{{ "\\n" }}'; } {{- end }}