Skip to content

Commit 248958d

Browse files
committed
🚩 Modify the priority of the rule
1 parent 469fddf commit 248958d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ngx_http_waf_module.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ static ngx_int_t ngx_http_waf_handler(ngx_http_request_t* r) {
209209

210210
}
211211

212-
if (ngx_regex_exec_array(srv_conf->white_url, &r->uri, r->connection->log) == NGX_OK) {
213-
return NGX_DECLINED;
214-
}
215-
216212
switch (r->connection->sockaddr->sa_family) {
217213
case AF_INET:
218214
if (check_ipv4(ipv4, srv_conf->block_ipv4) == SUCCESS) {
@@ -227,6 +223,10 @@ static ngx_int_t ngx_http_waf_handler(ngx_http_request_t* r) {
227223

228224
}
229225

226+
if (ngx_regex_exec_array(srv_conf->white_url, &r->uri, r->connection->log) == NGX_OK) {
227+
return NGX_DECLINED;
228+
}
229+
230230
if (ngx_regex_exec_array(srv_conf->block_url, &r->uri, r->connection->log) == NGX_OK) {
231231
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, "ngx_waf: URL");
232232
return NGX_HTTP_FORBIDDEN;

0 commit comments

Comments
 (0)