Skip to content

Commit

Permalink
Add check if there are any warrnings in the NGINX config validation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dhurley authored Mar 23, 2023
1 parent 2c252a2 commit d5bc91f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d5bc91f

Please sign in to comment.