Skip to content

Commit

Permalink
use-htx global config defaults to true
Browse files Browse the repository at this point in the history
Since haproxy v2.0-dev3 http-use-htx is enabled by default. Changing template and use-htx default configmap option accordingly.
  • Loading branch information
jcmoraisjr committed Oct 18, 2019
1 parent a8bc183 commit 11cd00f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
1 change: 1 addition & 0 deletions pkg/converters/ingress/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,6 @@ func createDefaults() map[string]string {
types.GlobalSyslogTag: "ingress",
types.GlobalTimeoutStop: "10m",
types.GlobalTLSALPN: "h2,http/1.1",
types.GlobalUseHTX: "true",
}
}
1 change: 1 addition & 0 deletions pkg/haproxy/instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2591,6 +2591,7 @@ func (c *testConfig) configGlobal(global *hatypes.Global) {
global.Timeout.ServerFin = "50s"
global.Timeout.Stop = "15m"
global.Timeout.Tunnel = "1h"
global.UseHTX = true
}

var endpointS0 = &hatypes.Endpoint{
Expand Down
22 changes: 2 additions & 20 deletions rootfs/etc/haproxy/template/haproxy.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ defaults
option dontlognull
option http-server-close
option http-keep-alive
{{- if $global.UseHTX }}
option http-use-htx
{{- if not $global.UseHTX }}
no option http-use-htx
{{- end }}
timeout client {{ default "--" $global.Timeout.Client }}
{{- if $global.Timeout.ClientFin }}
Expand Down Expand Up @@ -164,11 +164,6 @@ listen _tcp_{{ $backend.Name }}_{{ $backend.Port }}
{{- if $backend.ProxyProt.Decode }} accept-proxy{{ end }}
mode tcp

{{- /*------------------------------------*/}}
{{- if $global.UseHTX }}
no option http-use-htx
{{- end }}

{{- /*------------------------------------*/}}
{{- if $global.Syslog.Endpoint }}
{{- if eq $global.Syslog.TCPLogFormat "default" }}
Expand Down Expand Up @@ -246,11 +241,6 @@ backend {{ $backend.ID }}
{{- /*------------------------------------*/}}
{{- if $backend.ModeTCP }}

{{- /*------------------------------------*/}}
{{- if $global.UseHTX }}
no option http-use-htx
{{- end }}

{{- /*------------------------------------*/}}
{{- if $backend.WhitelistTCP }}
{{- range $w1 := short 10 $backend.WhitelistTCP }}
Expand Down Expand Up @@ -604,11 +594,6 @@ listen _front__tls
mode tcp
bind {{ $global.Bind.HTTPSBindIP }}:{{ $global.Bind.HTTPSPort }}{{ if $global.Bind.AcceptProxy }} accept-proxy{{ end }}

{{- /*------------------------------------*/}}
{{- if $global.UseHTX }}
no option http-use-htx
{{- end }}

{{- /*------------------------------------*/}}
{{- if $global.Syslog.Endpoint }}
{{- if eq $global.Syslog.HTTPSLogFormat "default" }}
Expand Down Expand Up @@ -1023,9 +1008,6 @@ backend spoe-modsecurity
mode tcp
timeout connect 5s
timeout server 5s
{{- if $global.UseHTX }}
no option http-use-htx
{{- end }}
{{- range $i, $endpoint := $global.ModSecurity.Endpoints }}
server modsec-spoa{{ $i }} {{ $endpoint }}
{{- end }}
Expand Down

0 comments on commit 11cd00f

Please sign in to comment.