diff --git a/src/core/nginx.go b/src/core/nginx.go index ffc6ee23d..d27322b39 100644 --- a/src/core/nginx.go +++ b/src/core/nginx.go @@ -269,6 +269,10 @@ func (n *NginxBinaryType) ValidateConfig(processId, bin, configLocation string, return fmt.Errorf("error running nginx -t -c %v:\n%s", configLocation, response) } + if strings.Contains(response.String(), "nginx: [warn]") { + return fmt.Errorf("error running nginx -t -c %v:\n%s", configLocation, response) + } + log.Infof("Config validated:\n%s", response) return nil diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/nginx.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/nginx.go index ffc6ee23d..d27322b39 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/nginx.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/nginx.go @@ -269,6 +269,10 @@ func (n *NginxBinaryType) ValidateConfig(processId, bin, configLocation string, return fmt.Errorf("error running nginx -t -c %v:\n%s", configLocation, response) } + if strings.Contains(response.String(), "nginx: [warn]") { + return fmt.Errorf("error running nginx -t -c %v:\n%s", configLocation, response) + } + log.Infof("Config validated:\n%s", response) return nil