nginx-module-modsecurity: updated to 1.0.1-2.
diff --git a/alpine/Makefile.module-modsecurity b/alpine/Makefile.module-modsecurity
index 3737429..ec5262c 100644
--- a/alpine/Makefile.module-modsecurity
+++ b/alpine/Makefile.module-modsecurity
@@ -6,7 +6,7 @@
 include $(CONTRIB)/src/modsecurity-nginx/version
 
 MODULE_VERSION_modsecurity=	$(MODSECURITY_NGINX_VERSION)
-MODULE_RELEASE_modsecurity=	1
+MODULE_RELEASE_modsecurity=	2
 LIBMODSECURITY_SOVER=		$(MODSECURITY_VERSION)
 
 MODULE_VERSION_PREFIX_modsecurity=$(MODULE_TARGET_PREFIX)
@@ -14,8 +14,7 @@
 MODULE_SOURCES_modsecurity=	modsecurity-v$(MODSECURITY_VERSION).tar.gz \
 				modsecurity-nginx-$(MODSECURITY_NGINX_GITHASH).tar.xz
 
-MODULE_PATCHES_modsecurity=	$(CONTRIB)/src/modsecurity/PR2348.patch \
-				$(CONTRIB)/src/modsecurity-nginx/PR165.patch
+MODULE_PATCHES_modsecurity=	$(CONTRIB)/src/modsecurity/PR2348.patch
 
 MODULE_CONFARGS_modsecurity=	--add-dynamic-module=$(MODSRC_PREFIX)modsecurity-nginx-$(MODSECURITY_NGINX_GITHASH)
 
diff --git a/contrib/src/modsecurity-nginx/Makefile b/contrib/src/modsecurity-nginx/Makefile
index ac768a5..25b9b9e 100644
--- a/contrib/src/modsecurity-nginx/Makefile
+++ b/contrib/src/modsecurity-nginx/Makefile
@@ -14,7 +14,6 @@
 
 modsecurity-nginx: modsecurity-nginx-$(MODSECURITY_NGINX_GITHASH).tar.xz .sum-modsecurity-nginx
 	$(UNPACK)
-	$(APPLY) $(SRC)/modsecurity-nginx/PR165.patch
 	$(MOVE)
 
 DEPS_modsecurity-nginx = modsecurity $(DEPS_modsecurity)
diff --git a/contrib/src/modsecurity-nginx/PR165.patch b/contrib/src/modsecurity-nginx/PR165.patch
deleted file mode 100644
index d0505e7..0000000
--- a/contrib/src/modsecurity-nginx/PR165.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From d8987f6476edd2ac9d5df99778f9e12cfbe8e83e Mon Sep 17 00:00:00 2001
-From: Andrei Belov <defanator@gmail.com>
-Date: Tue, 6 Aug 2019 16:32:15 +0300
-Subject: [PATCH] Avoid processing of subrequests initiated by the error_page
-
-Closes #164, SpiderLabs/ModSecurity#2143.
----
- src/ngx_http_modsecurity_header_filter.c | 4 ++++
- src/ngx_http_modsecurity_log.c           | 4 ++++
- src/ngx_http_modsecurity_pre_access.c    | 4 ++++
- src/ngx_http_modsecurity_rewrite.c       | 4 ++++
- 4 files changed, 16 insertions(+)
-
-diff --git a/src/ngx_http_modsecurity_header_filter.c b/src/ngx_http_modsecurity_header_filter.c
-index 3f9f748..04ad7ac 100644
---- a/src/ngx_http_modsecurity_header_filter.c
-+++ b/src/ngx_http_modsecurity_header_filter.c
-@@ -420,6 +420,10 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r)
- 
- /* XXX: if NOT_MODIFIED, do we need to process it at all?  see xslt_header_filter() */
- 
-+    if (r->error_page) {
-+        return ngx_http_next_header_filter(r);
-+    }
-+
-     ctx = ngx_http_get_module_ctx(r, ngx_http_modsecurity_module);
- 
-     dd("header filter, recovering ctx: %p", ctx);
-diff --git a/src/ngx_http_modsecurity_log.c b/src/ngx_http_modsecurity_log.c
-index 5546596..39cf6b7 100644
---- a/src/ngx_http_modsecurity_log.c
-+++ b/src/ngx_http_modsecurity_log.c
-@@ -41,6 +41,10 @@ ngx_http_modsecurity_log_handler(ngx_http_request_t *r)
-     ngx_http_modsecurity_ctx_t   *ctx;
-     ngx_http_modsecurity_conf_t  *mcf;
- 
-+    if (r->error_page) {
-+        return NGX_OK;
-+    }
-+
-     dd("catching a new _log_ phase handler");
- 
-     mcf = ngx_http_get_module_loc_conf(r, ngx_http_modsecurity_module);
-diff --git a/src/ngx_http_modsecurity_pre_access.c b/src/ngx_http_modsecurity_pre_access.c
-index 05d7140..d5389ad 100644
---- a/src/ngx_http_modsecurity_pre_access.c
-+++ b/src/ngx_http_modsecurity_pre_access.c
-@@ -48,6 +48,10 @@ ngx_http_modsecurity_pre_access_handler(ngx_http_request_t *r)
-     ngx_http_modsecurity_ctx_t   *ctx;
-     ngx_http_modsecurity_conf_t  *mcf;
- 
-+    if (r->error_page) {
-+        return NGX_DECLINED;
-+    }
-+
-     dd("catching a new _preaccess_ phase handler");
- 
-     mcf = ngx_http_get_module_loc_conf(r, ngx_http_modsecurity_module);
-diff --git a/src/ngx_http_modsecurity_rewrite.c b/src/ngx_http_modsecurity_rewrite.c
-index cd02438..fa178a2 100644
---- a/src/ngx_http_modsecurity_rewrite.c
-+++ b/src/ngx_http_modsecurity_rewrite.c
-@@ -27,6 +27,10 @@ ngx_http_modsecurity_rewrite_handler(ngx_http_request_t *r)
-     ngx_http_modsecurity_ctx_t   *ctx;
-     ngx_http_modsecurity_conf_t  *mcf;
- 
-+    if (r->error_page) {
-+        return NGX_DECLINED;
-+    }
-+
-     mcf = ngx_http_get_module_loc_conf(r, ngx_http_modsecurity_module);
-     if (mcf == NULL || mcf->enable != 1) {
-         dd("ModSecurity not enabled... returning");
diff --git a/contrib/src/modsecurity-nginx/version b/contrib/src/modsecurity-nginx/version
index 7555ca6..7b8bcab 100644
--- a/contrib/src/modsecurity-nginx/version
+++ b/contrib/src/modsecurity-nginx/version
@@ -1,2 +1,2 @@
 MODSECURITY_NGINX_VERSION := 1.0.1
-MODSECURITY_NGINX_GITHASH := e50e43ee4cc87565922ed98b1b6c72751019c326
+MODSECURITY_NGINX_GITHASH := 21bc8212a6e949a5eaf43a789212f5e260637da6
diff --git a/debian/Makefile.module-modsecurity b/debian/Makefile.module-modsecurity
index 1a9997e..cb3e12d 100644
--- a/debian/Makefile.module-modsecurity
+++ b/debian/Makefile.module-modsecurity
@@ -6,7 +6,7 @@
 include $(CONTRIB)/src/modsecurity-nginx/version
 
 MODULE_VERSION_modsecurity=	$(MODSECURITY_NGINX_VERSION)
-MODULE_RELEASE_modsecurity=	1
+MODULE_RELEASE_modsecurity=	2
 LIBMODSECURITY_SOVER=		$(MODSECURITY_VERSION)
 
 MODULE_VERSION_PREFIX_modsecurity=$(MODULE_TARGET_PREFIX)
@@ -14,8 +14,7 @@
 MODULE_SOURCES_modsecurity=	modsecurity-v$(MODSECURITY_VERSION).tar.gz \
 				modsecurity-nginx-$(MODSECURITY_NGINX_GITHASH).tar.xz
 
-MODULE_PATCHES_modsecurity=	$(CONTRIB)/src/modsecurity/PR2348.patch \
-				$(CONTRIB)/src/modsecurity-nginx/PR165.patch
+MODULE_PATCHES_modsecurity=	$(CONTRIB)/src/modsecurity/PR2348.patch
 
 MODULE_CONFARGS_modsecurity=	--add-dynamic-module=$(MODSRC_PREFIX)modsecurity-nginx-$(MODSECURITY_NGINX_GITHASH)
 
diff --git a/docs/nginx-module-modsecurity.xml b/docs/nginx-module-modsecurity.xml
index 884f989..2cbaddf 100644
--- a/docs/nginx-module-modsecurity.xml
+++ b/docs/nginx-module-modsecurity.xml
@@ -5,6 +5,20 @@
 <change_log title="nginx_module_modsecurity">
 
 
+<changes apply="nginx-module-modsecurity" ver="1.0.1" rev="2" basever="1.19.6"
+         date="2021-02-15" time="17:28:10 +0300"
+         packager="Andrei Belov &lt;defanator@gmail.com&gt;">
+
+<change>
+<para>
+ModSecurity-nginx updated to v1.0.1-23-g21bc821, see changelog at
+https://github.com/SpiderLabs/ModSecurity-nginx/blob/21bc821/CHANGES
+</para>
+</change>
+
+</changes>
+
+
 <changes apply="nginx-module-modsecurity" ver="1.0.1" rev="1" basever="1.19.6"
          date="2020-12-17" time="12:00:00 +0300"
          packager="Andrei Belov &lt;defanator@gmail.com&gt;">
diff --git a/rpm/SPECS/Makefile.module-modsecurity b/rpm/SPECS/Makefile.module-modsecurity
index 392a07c..04abb49 100644
--- a/rpm/SPECS/Makefile.module-modsecurity
+++ b/rpm/SPECS/Makefile.module-modsecurity
@@ -6,7 +6,7 @@
 include $(CONTRIB)/src/modsecurity-nginx/version
 
 MODULE_VERSION_modsecurity=	$(MODSECURITY_NGINX_VERSION)
-MODULE_RELEASE_modsecurity=	1
+MODULE_RELEASE_modsecurity=	2
 LIBMODSECURITY_SOVER=		$(MODSECURITY_VERSION)
 
 MODULE_VERSION_PREFIX_modsecurity=$(MODULE_TARGET_PREFIX)
@@ -14,8 +14,7 @@
 MODULE_SOURCES_modsecurity=	modsecurity-v$(MODSECURITY_VERSION).tar.gz \
 				modsecurity-nginx-$(MODSECURITY_NGINX_GITHASH).tar.xz
 
-MODULE_PATCHES_modsecurity=	$(CONTRIB)/src/modsecurity/PR2348.patch \
-				$(CONTRIB)/src/modsecurity-nginx/PR165.patch
+MODULE_PATCHES_modsecurity=	$(CONTRIB)/src/modsecurity/PR2348.patch
 
 MODULE_CONFARGS_modsecurity=	--add-dynamic-module=modsecurity-nginx-$(MODSECURITY_NGINX_GITHASH)