mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
Apply patches to Modsecurity-nginx
This commit is contained in:
parent
008dc09a60
commit
1e7f92af80
4 changed files with 11 additions and 11 deletions
|
@ -110,7 +110,7 @@ if test -n "$ngx_module_link"; then
|
|||
ngx_module_type=HTTP_FILTER
|
||||
ngx_module_name="$ngx_addon_name"
|
||||
ngx_module_srcs="$ngx_addon_dir/src/ngx_http_modsecurity_module.c \
|
||||
$ngx_addon_dir/src/ngx_http_modsecurity_pre_access.c \
|
||||
$ngx_addon_dir/src/ngx_http_modsecurity_access.c \
|
||||
$ngx_addon_dir/src/ngx_http_modsecurity_header_filter.c \
|
||||
$ngx_addon_dir/src/ngx_http_modsecurity_body_filter.c \
|
||||
$ngx_addon_dir/src/ngx_http_modsecurity_log.c \
|
||||
|
@ -141,7 +141,7 @@ else
|
|||
NGX_ADDON_SRCS="\
|
||||
$NGX_ADDON_SRCS \
|
||||
$ngx_addon_dir/src/ngx_http_modsecurity_module.c \
|
||||
$ngx_addon_dir/src/ngx_http_modsecurity_pre_access.c \
|
||||
$ngx_addon_dir/src/ngx_http_modsecurity_access.c \
|
||||
$ngx_addon_dir/src/ngx_http_modsecurity_header_filter.c \
|
||||
$ngx_addon_dir/src/ngx_http_modsecurity_body_filter.c \
|
||||
$ngx_addon_dir/src/ngx_http_modsecurity_log.c \
|
||||
|
|
|
@ -163,8 +163,8 @@ int ngx_http_modsecurity_store_ctx_header(ngx_http_request_t *r, ngx_str_t *name
|
|||
void ngx_http_modsecurity_log(void *log, const void* data);
|
||||
ngx_int_t ngx_http_modsecurity_log_handler(ngx_http_request_t *r);
|
||||
|
||||
/* ngx_http_modsecurity_pre_access.c */
|
||||
ngx_int_t ngx_http_modsecurity_pre_access_handler(ngx_http_request_t *r);
|
||||
/* ngx_http_modsecurity_access.c */
|
||||
ngx_int_t ngx_http_modsecurity_access_handler(ngx_http_request_t *r);
|
||||
|
||||
/* ngx_http_modsecurity_rewrite.c */
|
||||
ngx_int_t ngx_http_modsecurity_rewrite_handler(ngx_http_request_t *r);
|
||||
|
|
|
@ -30,7 +30,7 @@ ngx_http_modsecurity_log(void *log, const void* data)
|
|||
}
|
||||
msg = (const char *) data;
|
||||
|
||||
ngx_log_error(NGX_LOG_INFO, (ngx_log_t *)log, 0, "%s", msg);
|
||||
ngx_log_error(NGX_LOG_WARN, (ngx_log_t *)log, 0, "%s", msg);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -526,7 +526,7 @@ static ngx_int_t
|
|||
ngx_http_modsecurity_init(ngx_conf_t *cf)
|
||||
{
|
||||
ngx_http_handler_pt *h_rewrite;
|
||||
ngx_http_handler_pt *h_preaccess;
|
||||
ngx_http_handler_pt *h_access;
|
||||
ngx_http_handler_pt *h_log;
|
||||
ngx_http_core_main_conf_t *cmcf;
|
||||
int rc = 0;
|
||||
|
@ -556,18 +556,18 @@ ngx_http_modsecurity_init(ngx_conf_t *cf)
|
|||
|
||||
/**
|
||||
*
|
||||
* Processing the request body on the preaccess phase.
|
||||
* Processing the request body on the access phase.
|
||||
*
|
||||
* TODO: check if hook into separated phases is the best thing to do.
|
||||
*
|
||||
*/
|
||||
h_preaccess = ngx_array_push(&cmcf->phases[NGX_HTTP_PREACCESS_PHASE].handlers);
|
||||
if (h_preaccess == NULL)
|
||||
h_access = ngx_array_push(&cmcf->phases[NGX_HTTP_ACCESS_PHASE].handlers);
|
||||
if (h_access == NULL)
|
||||
{
|
||||
dd("Not able to create a new NGX_HTTP_PREACCESS_PHASE handle");
|
||||
dd("Not able to create a new NGX_HTTP_ACCESS_PHASE handle");
|
||||
return NGX_ERROR;
|
||||
}
|
||||
*h_preaccess = ngx_http_modsecurity_pre_access_handler;
|
||||
*h_access = ngx_http_modsecurity_access_handler;
|
||||
|
||||
/**
|
||||
* Process the log phase.
|
||||
|
|
Loading…
Reference in a new issue