@@ -164,15 +164,7 @@ frontend public
164
164
acl secure_redirect base,map_reg(/var/lib/haproxy/conf/os_route_http_redirect.map) -m found
165
165
redirect scheme https if secure_redirect
166
166
167
- # Check if it is an edge or reencrypt route exposed insecurely.
168
- acl route_http_expose base,map_reg(/var/lib/haproxy/conf/os_route_http_expose.map) -m found
169
- use_backend %[base,map_reg(/var/lib/haproxy/conf/os_route_http_expose.map)] if route_http_expose
170
-
171
- # map to http backend
172
- # Search from most specific to general path (host case).
173
- # Note: If no match, haproxy uses the default_backend, no other
174
- # use_backend directives below this will be processed.
175
- use_backend be_http:%[base,map_reg(/var/lib/haproxy/conf/os_http_be.map)]
167
+ use_backend %[base,map_reg(/var/lib/haproxy/conf/os_http_be.map)]
176
168
177
169
default_backend openshift_default
178
170
@@ -233,17 +225,11 @@ frontend fe_sni
233
225
# before matching, or any requests containing uppercase characters will never match.
234
226
http-request set-header Host %[req.hdr(Host),lower]
235
227
236
- # check re-encrypt backends first - from most specific to general path.
237
- acl reencrypt base,map_reg(/var/lib/haproxy/conf/os_reencrypt.map) -m found
238
-
239
- # Search from most specific to general path (host case).
240
- use_backend be_secure:%[base,map_reg(/var/lib/haproxy/conf/os_reencrypt.map)] if reencrypt
241
-
242
- # map to http backend
228
+ # map to backend
243
229
# Search from most specific to general path (host case).
244
230
# Note: If no match, haproxy uses the default_backend, no other
245
231
# use_backend directives below this will be processed.
246
- use_backend be_edge_http: %[base,map_reg(/var/lib/haproxy/conf/os_edge_http_be.map)]
232
+ use_backend %[base,map_reg(/var/lib/haproxy/conf/os_edge_http_be.map)]
247
233
248
234
default_backend openshift_default
249
235
@@ -274,17 +260,12 @@ frontend fe_no_sni
274
260
# before matching, or any requests containing uppercase characters will never match.
275
261
http-request set-header Host %[req.hdr(Host),lower]
276
262
277
- # check re-encrypt backends first - path or host based.
278
- acl reencrypt base,map_reg(/var/lib/haproxy/conf/os_reencrypt.map) -m found
279
-
280
- # Search from most specific to general path (host case).
281
- use_backend be_secure:%[base,map_reg(/var/lib/haproxy/conf/os_reencrypt.map)] if reencrypt
282
263
283
- # map to http backend
264
+ # map to backend
284
265
# Search from most specific to general path (host case).
285
266
# Note: If no match, haproxy uses the default_backend, no other
286
267
# use_backend directives below this will be processed.
287
- use_backend be_edge_http: %[base,map_reg(/var/lib/haproxy/conf/os_edge_http_be.map)]
268
+ use_backend %[base,map_reg(/var/lib/haproxy/conf/os_edge_http_be.map)]
288
269
289
270
default_backend openshift_default
290
271
@@ -494,46 +475,45 @@ backend be_tcp:{{$cfgIdx}}
494
475
{{ end -}}{{/* end if router allows wildcard routes */}}
495
476
{{ end -}}{{/* end wildcard domain map template */}}
496
477
478
+
479
+
497
480
{{/*
498
- os_http_be.map: contains a mapping of www.example.com -> <service name>. This map is used to discover the correct backend
499
- by attaching a prefix (be_http:) by use_backend statements if acls are matched.
481
+ os_http_be.map : contains a mapping of www.example.com -> <service name>. This map is used to discover the correct backend
482
+ by attaching a prefix: be_http for http routes
483
+ be_edge_http for edge routes with InsecureEdgeTerminationPolicy Allow
484
+ be_secure for reencrypt routes with InsecureEdgeTerminationPolicy Allow
500
485
*/}}
501
486
{{ define "/var/lib/haproxy/conf/os_http_be.map" -}}
502
487
{{ range $idx, $cfg := .State -}}
503
488
{{ if and (ne $cfg.Host "") (eq $cfg.TLSTermination "") -}}
504
- {{generateRouteRegexp $cfg.Host $cfg.Path $cfg.IsWildcard}} {{$idx}}
489
+ {{generateRouteRegexp $cfg.Host $cfg.Path $cfg.IsWildcard}} be_http:{{$idx}}
490
+ {{ end -}}
491
+ {{ if and (ne $cfg.Host "") (and (matchValues (print $cfg.TLSTermination) "edge" "reencrypt") (eq $cfg.InsecureEdgeTerminationPolicy "Allow")) -}}
492
+ {{ if (eq $cfg.TLSTermination "edge") -}}
493
+ {{generateRouteRegexp $cfg.Host $cfg.Path $cfg.IsWildcard}} be_edge_http:{{$idx}}
494
+ {{ else -}}
495
+ {{generateRouteRegexp $cfg.Host $cfg.Path $cfg.IsWildcard}} be_secure:{{$idx}}
496
+ {{ end -}}
505
497
{{ end -}}
506
498
{{ end -}}
507
- {{ end -}}{{/* end http host map template */}}
499
+ {{ end -}}
508
500
509
501
{{/*
510
- os_edge_http_be.map: same as os_http_be.map but allows us to separate tls from non-tls routes to ensure we don't expose
511
- a tls only route on the unsecure port
502
+ os_edge_reencrypt_be.map : contains a mapping of www.example.com -> <service name>. This map is similar to os_http_be.map but for tls routes.
503
+ by attaching prefix: be_edge_http for edge terminated routes
504
+ be_secure for reencrypt routes
512
505
*/}}
513
506
{{ define "/var/lib/haproxy/conf/os_edge_http_be.map" -}}
514
507
{{ range $idx, $cfg := .State -}}
515
508
{{ if and (ne $cfg.Host "") (eq $cfg.TLSTermination "edge") -}}
516
- {{generateRouteRegexp $cfg.Host $cfg.Path $cfg.IsWildcard}} {{$idx}}
517
- {{ end -}}
518
- {{ end -}}
519
- {{ end -}}{{/* end edge http host map template */}}
520
-
521
- {{/*
522
- os_route_http_expose.map: contains a mapping of www.example.com -> <service name>.
523
- Map is used to also expose edge terminated and reencrypt routes via an insecure scheme
524
- (http) if acls match for routes with insecure option set to expose.
525
- */}}
526
- {{ define "/var/lib/haproxy/conf/os_route_http_expose.map" -}}
527
- {{ range $idx, $cfg := .State -}}
528
- {{ if and (ne $cfg.Host "") (and (matchValues (print $cfg.TLSTermination) "edge" "reencrypt") (eq $cfg.InsecureEdgeTerminationPolicy "Allow")) -}}
529
- {{ if (eq $cfg.TLSTermination "edge") -}}
530
509
{{generateRouteRegexp $cfg.Host $cfg.Path $cfg.IsWildcard}} be_edge_http:{{$idx}}
531
- {{ else -}}
510
+ {{ end -}}
511
+ {{ if and (ne $cfg.Host "") (eq $cfg.TLSTermination "reencrypt") -}}
532
512
{{generateRouteRegexp $cfg.Host $cfg.Path $cfg.IsWildcard}} be_secure:{{$idx}}
533
- {{ end -}}
534
513
{{ end -}}
535
514
{{ end -}}
536
- {{ end -}}{{/* end edge and reencrypt expose http host map template */}}
515
+ {{ end -}}{{/* end edge http host map template */}}
516
+
537
517
538
518
{{/*
539
519
os_route_http_redirect.map: contains a mapping of www.example.com -> <service name>.
@@ -573,19 +553,6 @@ backend be_tcp:{{$cfgIdx}}
573
553
{{ end -}}
574
554
{{ end -}}{{/* end sni passthrough map template */}}
575
555
576
-
577
- {{/*
578
- os_reencrypt.map: marker that the host is configured to use a secure backend, allows the selection of a backend
579
- that does specific checks that avoid mitm attacks: http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#5.2-ssl
580
- */}}
581
- {{ define "/var/lib/haproxy/conf/os_reencrypt.map" -}}
582
- {{ range $idx, $cfg := .State -}}
583
- {{ if and (ne $cfg.Host "") (eq $cfg.TLSTermination "reencrypt") -}}
584
- {{generateRouteRegexp $cfg.Host $cfg.Path $cfg.IsWildcard}} {{$idx}}
585
- {{ end -}}
586
- {{ end -}}
587
- {{ end -}}{{/* end reencrypt map template */}}
588
-
589
556
{{/*
590
557
cert_config.map: contains a mapping of <cert-file> -> example.org
591
558
This map is used to present the appropriate cert
0 commit comments