Disable features not availables in some platforms
This commit is contained in:
parent
0d2434f87f
commit
fdd231816c
4 changed files with 22 additions and 11 deletions
|
|
@ -335,7 +335,7 @@ type Configuration struct {
|
|||
|
||||
// Enables or disables the use of the NGINX Brotli Module for compression
|
||||
// https://github.com/google/ngx_brotli
|
||||
UseBrotli bool `json:"use-brotli,omitempty"`
|
||||
EnableBrotli bool `json:"enable-brotli,omitempty"`
|
||||
|
||||
// Brotli Compression Level that will be used
|
||||
BrotliLevel int `json:"brotli-level,omitempty"`
|
||||
|
|
@ -476,7 +476,7 @@ func NewDefault() Configuration {
|
|||
SSLSessionCacheSize: sslSessionCacheSize,
|
||||
SSLSessionTickets: true,
|
||||
SSLSessionTimeout: sslSessionTimeout,
|
||||
UseBrotli: true,
|
||||
EnableBrotli: true,
|
||||
UseGzip: true,
|
||||
WorkerProcesses: strconv.Itoa(runtime.NumCPU()),
|
||||
WorkerShutdownTimeout: "10s",
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import (
|
|||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
|
@ -598,6 +599,15 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) error {
|
|||
|
||||
cfg.SSLDHParam = sslDHParam
|
||||
|
||||
// disable features are not available in some platforms
|
||||
switch runtime.GOARCH {
|
||||
case "arm", "arm64", "ppc64le":
|
||||
cfg.EnableModsecurity = false
|
||||
case "s390x":
|
||||
cfg.EnableModsecurity = false
|
||||
cfg.EnableBrotli = false
|
||||
}
|
||||
|
||||
tc := ngx_config.TemplateConfig{
|
||||
ProxySetHeaders: setHeaders,
|
||||
AddHeaders: addHeaders,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue