Closed dareste closed 10 months ago
Agreed that snippet should work, although I think the mask should just be nginxAnyConf | nginxConfTake1
based on the NGINX source.
Will you open a PR?
I agree that the mask should be consistent with what we see in the NGINX source definition. The problem is that here we define ngxAnyConf
as "any context except server > if
, location > if
and location > limit_except
":
The only place where we use ngxAnyConf
is when we define the include
directive, so I think we should be ok by changing the ngxAnyConf
definition to include these three exceptions, which are valid contexts for the include
directive.
I'll open a PR.
The following block of code is a valid nginx configuration:
Despite that, the tool detects the "include" as a non-allowed directive under the "if" context:
To reproduce
nginx-go-crossplane
latest version, and see the above error.Expected behavior
The mentioned config shouldn't be throwing an error.
Additional context
This is likely caused by the directives map config here: https://github.com/nginxinc/nginx-go-crossplane/blob/73c76f92a13211c7b1488dfa746d9f3353b82ff8/analyze.go#L791
I think we should modify the mask to include the "http > location > if"