Skip to content

Commit 8a01f6e

Browse files
fix(internal-gateway): fix api path (#50)
1 parent 2df607c commit 8a01f6e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

charts/internal-gateway/templates/_components/_configmap.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ data:
7575
{{- if $val.enabled }}
7676
location {{ $key }} {
7777
78-
{{- $location_host := printf "location_host%s" (trimSuffix "/" $key | replace "/" "_" | replace "." "_" | replace "-" "_" | lower ) }}
79-
{{- $location_port := printf "location_port%s" (trimSuffix "/" $key | replace "/" "_" | replace "." "_" | replace "-" "_" | lower ) }}
78+
{{- $location_host := printf "location_host_%s" (regexReplaceAll "\\W+" $key "") }}
79+
{{- $location_port := printf "location_port_%s" (regexReplaceAll "\\W+" $key "") }}
8080
set ${{ $location_host }} {{ $val.proxy.host }};
8181
set ${{ $location_port }} {{ $val.proxy.port }};
8282

charts/internal-gateway/templates/_location_map.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ locationSnippet: |
1313
proxy_set_header X-Original-URI $request_uri;
1414
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
1515
proxy_set_header X-Forwarded-Proto $scheme;
16+
proxy_redirect off;
1617
locationDirectives:
1718
proxy_buffer_size: "64k"
1819
proxy_buffers: "4 64k"
@@ -136,6 +137,16 @@ nginx:
136137
locationDirectives:
137138
{{- $presets.locationDirectives | toYaml | nindent 10 }}
138139

140+
= /api:
141+
enabled: true
142+
proxy:
143+
host: {{ index $endpoints.serviceEndpoints "cfapi-endpoints" "svc" }}
144+
port: {{ index $endpoints.serviceEndpoints "cfapi-endpoints" "port" }}
145+
locationSnippet:
146+
{{- $presets.locationSnippet | toYaml | nindent 10 }}
147+
locationDirectives:
148+
{{- $presets.locationDirectives | toYaml | nindent 10 }}
149+
139150
/api/environments-v2/argo/events:
140151
enabled: true
141152
proxy:

0 commit comments

Comments
 (0)