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 committed Mar 15, 2023
1 parent 1f1d81c commit 98a9f3d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sdk/proto/events/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ message SecurityViolationEvent {
// DEPRECATED
reserved 39;
reserved "NginxID";

string PolicyName = 1 [(gogoproto.jsontag) = "policy_name"];
string SupportID = 2 [(gogoproto.jsontag) = "support_id"];

Expand Down
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.

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

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

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

0 comments on commit 98a9f3d

Please sign in to comment.