update condition and replacement

This commit is contained in:
linweizhe 2024-04-09 02:30:44 +08:00
parent 8216e113e8
commit a0f8050b5a

View file

@ -276,8 +276,8 @@
grpc_pass {{ trim $proto }}://{{ trim $upstream }}; grpc_pass {{ trim $proto }}://{{ trim $upstream }};
{{- else }} {{- else }}
proxy_pass {{ trim $proto }}://{{ trim $upstream }}{{ trim $dest }}; proxy_pass {{ trim $proto }}://{{ trim $upstream }}{{ trim $dest }};
{{- if not (eq .Path "/") }} {{- if (hasPrefix "/" $dest) }}
proxy_redirect ~^/(.*)$ {{ trimSuffix `/` .Path }}/$1; proxy_redirect ~^{{ $dest }}(.*)$ {{ .Path }}$1;
{{- end }} {{- end }}
set $upstream_keepalive {{ if ne $keepalive "disabled" }}true{{ else }}false{{ end }}; set $upstream_keepalive {{ if ne $keepalive "disabled" }}true{{ else }}false{{ end }};
{{- end }} {{- end }}