Skip to content

Commit 310dc6c

Browse files
committed
Support path routes with port number in Host header
Fixes #8471.
1 parent 5986a92 commit 310dc6c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

images/router/haproxy/conf/haproxy-config.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ backend be_secure_{{$cfgIdx}}
254254
{{ range $idx, $cfg := $serviceUnit.ServiceAliasConfigs }}
255255
{{ if and (ne $cfg.Host "") (eq $cfg.TLSTermination "")}}
256256
{{$cfg.Host}}{{$cfg.Path}} {{$idx}}
257+
{{$cfg.Host}}{{env "ROUTER_SERVICE_HTTP_PORT" "80"}}{{$cfg.Path}} {{$idx}}
257258
{{ end }}
258259
{{ end }}
259260
{{ end }}
@@ -268,6 +269,7 @@ backend be_secure_{{$cfgIdx}}
268269
{{ range $idx, $cfg := $serviceUnit.ServiceAliasConfigs }}
269270
{{ if and (ne $cfg.Host "") (eq $cfg.TLSTermination "edge")}}
270271
{{$cfg.Host}}{{$cfg.Path}} {{$idx}}
272+
{{$cfg.Host}}{{env "ROUTER_SERVICE_HTTPS_PORT" "443"}}{{$cfg.Path}} {{$idx}}
271273
{{ end }}
272274
{{ end }}
273275
{{ end }}
@@ -283,6 +285,7 @@ backend be_secure_{{$cfgIdx}}
283285
{{ range $idx, $cfg := $serviceUnit.ServiceAliasConfigs }}
284286
{{ if and (ne $cfg.Host "") (and (eq $cfg.TLSTermination "edge") (eq $cfg.InsecureEdgeTerminationPolicy "Allow"))}}
285287
{{$cfg.Host}}{{$cfg.Path}} {{$idx}}
288+
{{$cfg.Host}}{{env "ROUTER_SERVICE_HTTP_PORT" "80"}}{{$cfg.Path}} {{$idx}}
286289
{{ end }}
287290
{{ end }}
288291
{{ end }}
@@ -298,6 +301,7 @@ backend be_secure_{{$cfgIdx}}
298301
{{ range $idx, $cfg := $serviceUnit.ServiceAliasConfigs }}
299302
{{ if and (ne $cfg.Host "") (and (eq $cfg.TLSTermination "edge") (eq $cfg.InsecureEdgeTerminationPolicy "Redirect"))}}
300303
{{$cfg.Host}}{{$cfg.Path}} {{$idx}}
304+
{{$cfg.Host}}{{env "ROUTER_SERVICE_HTTP_PORT" "80"}}{{$cfg.Path}} {{$idx}}
301305
{{ end }}
302306
{{ end }}
303307
{{ end }}
@@ -342,6 +346,7 @@ backend be_secure_{{$cfgIdx}}
342346
{{ range $idx, $cfg := $serviceUnit.ServiceAliasConfigs }}
343347
{{ if and (ne $cfg.Host "") (eq $cfg.TLSTermination "reencrypt") }}
344348
{{$cfg.Host}}{{$cfg.Path}} {{$idx}}
349+
{{$cfg.Host}}{{env "ROUTER_SERVICE_HTTPS_PORT" "443"}}{{$cfg.Path}} {{$idx}}
345350
{{ end }}
346351
{{ end }}
347352
{{ end }}

0 commit comments

Comments
 (0)