[GH-ISSUE #106] nginx: [emerg] "waf_cc_deny" directive is not allowed her #81

Closed
opened 2026-03-04 12:18:46 +03:00 by kerem · 2 comments
Owner

Originally created by @gongwenbin on GitHub (Aug 26, 2022).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/106

ngx_waf版本 current
nginx版本:1.20.2
操作系统:centos7.9
现象:
1、将”waf_cc_deny on rate=10000r/m duration=10m zone=waf:cc;
waf_cache on capacity=50;“
加入到http段里面,会报错”nginx: [emerg] "waf_cc_deny" directive is not allowed here in /app/software/nginx/conf/nginx.conf:34
nginx: configuration file /app/software/nginx/conf/nginx.conf test failed“。
但是如果加入server则正常。

2、access_log /app/logs/nginx/waf_block.log waf if=$waf_blocking_log; 加入到http段里面不生效,需要加入到server方可。

Originally created by @gongwenbin on GitHub (Aug 26, 2022). Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/106 ngx_waf版本 current nginx版本:1.20.2 操作系统:centos7.9 现象: 1、将”waf_cc_deny on rate=10000r/m duration=10m zone=waf:cc; waf_cache on capacity=50;“ 加入到http段里面,会报错”nginx: [emerg] "waf_cc_deny" directive is not allowed here in /app/software/nginx/conf/nginx.conf:34 nginx: configuration file /app/software/nginx/conf/nginx.conf test failed“。 但是如果加入server则正常。 2、access_log /app/logs/nginx/waf_block.log waf if=$waf_blocking_log; 加入到http段里面不生效,需要加入到server方可。
kerem 2026-03-04 12:18:46 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@ADD-SP commented on GitHub (Aug 26, 2022):

目前本模块不支持这两种写法。

<!-- gh-comment-id:1228425425 --> @ADD-SP commented on GitHub (Aug 26, 2022): 目前本模块不支持这两种写法。
Author
Owner

@ADD-SP commented on GitHub (Aug 26, 2022):

不过第二个现象确实需要加到文档里。

<!-- gh-comment-id:1228426235 --> @ADD-SP commented on GitHub (Aug 26, 2022): 不过第二个现象确实需要加到文档里。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ngx_waf#81
No description provided.