Describe the bug
Documentation indicates waf_maps.conf should be included within the nginx.conf http directive. However, waf_maps.conf contains an http directive. Nginx does not permit nested http directives, resulting in
root@instance-20231029-2110:/home/ubuntu# nginx -t && service nginx reload
2026/06/08 01:57:07 [emerg] 1166803#1166803: "http" directive is not allowed here in /etc/nginx/waf_patterns/waf_maps.conf:3
nginx: configuration file /etc/nginx/nginx.conf test failed
This can be validated with a minimal test case:
Running nginx -t -c /path/to/test against:
passes without errors, while running the same against
replicates the same error message
To Reproduce
Steps to reproduce the behavior:
- Start with functioning nginx site.
- Follow documentation at https://fabriziosalmi.github.io/patterns/nginx.
- Run
nginx -t
- See error
Expected behavior
Following documentation results in working site
Error messages/logs
If applicable, add error messages or log output to help explain your problem.
Provided above
Environment (please complete the following information):
- OS: Ubuntu 24.04.1
- Python Version: N/a
- Web Server: Nginx 1.24.0
- Installation Method: downloaded pre-generated configs
Additional context
I suspect a contributing factor is that the nginx rule tests use nginxinc/crossplane to parse the configs, but don’t test the evaluation with a demo nginx site.
Describe the bug
Documentation indicates waf_maps.conf should be included within the nginx.conf http directive. However, waf_maps.conf contains an http directive. Nginx does not permit nested http directives, resulting in
This can be validated with a minimal test case:
Running
nginx -t -c /path/to/testagainst:passes without errors, while running the same against
replicates the same error message
To Reproduce
Steps to reproduce the behavior:
nginx -tExpected behavior
Following documentation results in working site
Error messages/logs
If applicable, add error messages or log output to help explain your problem.
Provided above
Environment (please complete the following information):
Additional context
I suspect a contributing factor is that the nginx rule tests use nginxinc/crossplane to parse the configs, but don’t test the evaluation with a demo nginx site.