git: 27e43ec029b1 - main - www/{nginx,nginx-devel,freenginx}: 3rd-party modules management

From: Jochen Neumeister <joneum_at_FreeBSD.org>
Date: Sat, 10 Oct 2026 18:02:48 UTC
The branch main has been updated by joneum:

URL: https://cgit.FreeBSD.org/ports/commit/?id=27e43ec029b11b257535903f0ccc57b798a5427c

commit 27e43ec029b11b257535903f0ccc57b798a5427c
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2026-10-10 18:00:22 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2026-10-10 18:02:34 +0000

    www/{nginx,nginx-devel,freenginx}: 3rd-party modules management
    
    Build the let, slowfs_cache, websockify and zstd modules from their own
    source ports instead of fetching them with GH_TUPLE.
    
    Sponsored by:   Netzkommune GmbH
---
 www/freenginx/Makefile                             | 22 +++++++-
 www/freenginx/Makefile.extmod                      | 15 +++---
 www/freenginx/distinfo                             |  8 ---
 www/freenginx/files/extra-patch-zstd-empty-flush   | 41 ---------------
 www/freenginx/files/extra-patch-zstd-full-outbuf   | 18 -------
 .../files/extra-patch-zstd-last-truncation         | 60 ----------------------
 www/nginx-devel/Makefile                           | 22 +++++++-
 www/nginx-devel/Makefile.extmod                    | 15 +++---
 www/nginx-devel/distinfo                           |  8 ---
 www/nginx-devel/files/extra-patch-zstd-empty-flush | 41 ---------------
 www/nginx-devel/files/extra-patch-zstd-full-outbuf | 18 -------
 .../files/extra-patch-zstd-last-truncation         | 60 ----------------------
 www/nginx/Makefile                                 | 22 +++++++-
 www/nginx/Makefile.extmod                          | 15 +++---
 www/nginx/distinfo                                 |  8 ---
 www/nginx/files/extra-patch-zstd-empty-flush       | 41 ---------------
 www/nginx/files/extra-patch-zstd-full-outbuf       | 18 -------
 www/nginx/files/extra-patch-zstd-last-truncation   | 60 ----------------------
 18 files changed, 87 insertions(+), 405 deletions(-)

diff --git a/www/freenginx/Makefile b/www/freenginx/Makefile
index a873267c0840..66621d84433c 100644
--- a/www/freenginx/Makefile
+++ b/www/freenginx/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	freenginx
 PORTVERSION=	${NGINX_VERSION}
 .include "version.mk"
-PORTREVISION?=	19
+PORTREVISION?=	20
 CATEGORIES=	www
 MASTER_SITES=	https://freenginx.org/download/ \
 		LOCAL/joneum
@@ -358,6 +358,11 @@ pre-configure-FORMINPUT-on:
 	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-form-input ${WRKSRC_forminput}
 	@${CHMOD} -R u+w ${WRKSRC_forminput}
 
+pre-configure-LET-on:
+	@${RM} -rf ${WRKSRC_let}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-let ${WRKSRC_let}
+	@${CHMOD} -R u+w ${WRKSRC_let}
+
 pre-configure-LUA-on:
 	@${RM} -rf ${WRKSRC_lua}
 	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-lua ${WRKSRC_lua}
@@ -374,11 +379,26 @@ pre-configure-NJS-on:
 	@${CHMOD} -R u+w ${WRKSRC_njs}
 	@${CHMOD} u+x ${WRKSRC_njs}/configure
 
+pre-configure-SLOWFS_CACHE-on:
+	@${RM} -rf ${WRKSRC_slowfs_cache}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-slowfs-cache ${WRKSRC_slowfs_cache}
+	@${CHMOD} -R u+w ${WRKSRC_slowfs_cache}
+
 pre-configure-VOD-on:
 	@${RM} -rf ${WRKSRC_vod}
 	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-vod ${WRKSRC_vod}
 	@${CHMOD} -R u+w ${WRKSRC_vod}
 
+pre-configure-WEBSOCKIFY-on:
+	@${RM} -rf ${WRKSRC_websockify}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-websockify ${WRKSRC_websockify}
+	@${CHMOD} -R u+w ${WRKSRC_websockify}
+
+pre-configure-ZSTD-on:
+	@${RM} -rf ${WRKSRC_zstd}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-zstd ${WRKSRC_zstd}
+	@${CHMOD} -R u+w ${WRKSRC_zstd}
+
 do-configure-NJS-on:
 	( cd ${WRKSRC_njs} && ${SETENV} ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${NJS_CONFIGURE_ARGS} )
 
diff --git a/www/freenginx/Makefile.extmod b/www/freenginx/Makefile.extmod
index 96a38adad212..c2f33b2a8f7e 100644
--- a/www/freenginx/Makefile.extmod
+++ b/www/freenginx/Makefile.extmod
@@ -212,7 +212,8 @@ ICONV_GH_TUPLE=		calio:iconv-nginx-module:v0.14:iconv
 ICONV_VARS=		DSO_EXTMODS+=iconv
 ICONV_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-calio-iconv-nginx-module-config
 
-LET_GH_TUPLE=		baysao:nginx-let-module:c1f23aa:let
+LET_BUILD_DEPENDS=	nginx-module-let>0:www/nginx-module-let
+WRKSRC_let=		${WRKDIR}/nginx-let-module
 LET_VARS=		DSO_EXTMODS+=let
 
 LUA_IMPLIES=		DEVEL_KIT
@@ -325,7 +326,8 @@ SFLOW_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_sflow_config.c \
 SHIBBOLETH_GH_TUPLE=	nginx-shib:nginx-http-shibboleth:be12df5:shibboleth
 SHIBBOLETH_VARS=	DSO_EXTMODS+=shibboleth
 
-SLOWFS_CACHE_GH_TUPLE=	baysao:ngx_slowfs_cache:d011a18:slowfs_cache
+SLOWFS_CACHE_BUILD_DEPENDS=	nginx-module-slowfs-cache>0:www/nginx-module-slowfs-cache
+WRKSRC_slowfs_cache=	${WRKDIR}/nginx-slowfs-cache-module
 SLOWFS_CACHE_VARS=	DSO_EXTMODS+=slowfs_cache
 
 SRCACHE_GH_TUPLE=	openresty:srcache-nginx-module:be22ac0:srcache
@@ -349,14 +351,13 @@ XSS_GH_TUPLE=		openresty:xss-nginx-module:v0.06:xss
 XSS_VARS=		DSO_EXTMODS+=xss
 XSS_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-xss-nginx-module-config
 
-WEBSOCKIFY_GH_TUPLE=	tg123:websockify-nginx-module:c11bc9a:websockify
+WEBSOCKIFY_BUILD_DEPENDS=	nginx-module-websockify>0:www/nginx-module-websockify
+WRKSRC_websockify=	${WRKDIR}/nginx-websockify-module
 WEBSOCKIFY_VARS=	DSO_EXTMODS+=websockify
 
 ZSTD_LIB_DEPENDS=	libzstd.so:archivers/zstd
 ZSTD_CONFIGURE_ENV=	ZSTD_INC=${LOCALBASE}/include \
 			ZSTD_LIB=${LOCALBASE}/lib
-ZSTD_GH_TUPLE=		tokers:zstd-nginx-module:f4ba115:zstd
+ZSTD_BUILD_DEPENDS=	nginx-module-zstd>0:www/nginx-module-zstd
+WRKSRC_zstd=		${WRKDIR}/nginx-zstd-module
 ZSTD_VARS=		DSO_EXTMODS+=zstd
-ZSTD_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-zstd-empty-flush \
-			${PATCHDIR}/extra-patch-zstd-last-truncation \
-			${PATCHDIR}/extra-patch-zstd-full-outbuf
diff --git a/www/freenginx/distinfo b/www/freenginx/distinfo
index 26749afae481..68ea0d028f72 100644
--- a/www/freenginx/distinfo
+++ b/www/freenginx/distinfo
@@ -79,8 +79,6 @@ SHA256 (evanmiller-mod_zip-a9f9afa_GH0.tar.gz) = 645035b7d7a83ab3f47c692386e85be
 SIZE (evanmiller-mod_zip-a9f9afa_GH0.tar.gz) = 30917
 SHA256 (calio-iconv-nginx-module-v0.14_GH0.tar.gz) = b8b9f355c05c0790226512f6732348a2404d48531688a1fc04ce6768163bf462
 SIZE (calio-iconv-nginx-module-v0.14_GH0.tar.gz) = 13133
-SHA256 (baysao-nginx-let-module-c1f23aa_GH0.tar.gz) = 7393809d5d8877812da1bd5b5fbd1d8b00bc85e71f2f387c344f007773e49050
-SIZE (baysao-nginx-let-module-c1f23aa_GH0.tar.gz) = 20617
 SHA256 (Taymindis-nginx-link-function-3.2.4_GH0.tar.gz) = 20c3679199ba7efe1598f03b2fa0b13591226363c8dd7930d7f02702cd5abada
 SIZE (Taymindis-nginx-link-function-3.2.4_GH0.tar.gz) = 139656
 SHA256 (openresty-memc-nginx-module-v0.19_GH0.tar.gz) = 8c2bdbe875e4f5225d0778bfb09a2668f9281d7de6218c7b462a7ba2cee06fe8
@@ -109,17 +107,11 @@ SHA256 (sflow-nginx-sflow-module-543c72a_GH0.tar.gz) = 95efdb1f6cfd6c32c577707f6
 SIZE (sflow-nginx-sflow-module-543c72a_GH0.tar.gz) = 29504
 SHA256 (nginx-shib-nginx-http-shibboleth-be12df5_GH0.tar.gz) = aff9830b5de78dd9ce32cd2c55c5cf9173c99fe1a1d2190407c96668e7517bab
 SIZE (nginx-shib-nginx-http-shibboleth-be12df5_GH0.tar.gz) = 23872
-SHA256 (baysao-ngx_slowfs_cache-d011a18_GH0.tar.gz) = 6ae8abb01a2aff788e75ec68621cb0159148a6f73730a84b30b0bdbc6cdc1758
-SIZE (baysao-ngx_slowfs_cache-d011a18_GH0.tar.gz) = 11186
 SHA256 (openresty-srcache-nginx-module-be22ac0_GH0.tar.gz) = 5753d1ffe87b5d6f5b7a0696667bb5ff1388738136fdee26ba55bc33f5796061
 SIZE (openresty-srcache-nginx-module-be22ac0_GH0.tar.gz) = 51029
 SHA256 (vozlt-nginx-module-sts-3c10d42_GH0.tar.gz) = 748b67ceb82b3b843ae915bf7863fd08b7c2427c045e5ec540242d050f7b30d0
 SIZE (vozlt-nginx-module-sts-3c10d42_GH0.tar.gz) = 352431
 SHA256 (vozlt-nginx-module-vts-bf64dbf_GH0.tar.gz) = d2782c75e39cb2ecf68453922b43ab2295adb6a35fa6a0f9c14173f70d22d7b1
 SIZE (vozlt-nginx-module-vts-bf64dbf_GH0.tar.gz) = 180394
-SHA256 (tg123-websockify-nginx-module-c11bc9a_GH0.tar.gz) = aca454bffcee2476dc92682ebfb8c0378a271fda178be7e945d648419d220758
-SIZE (tg123-websockify-nginx-module-c11bc9a_GH0.tar.gz) = 14646
 SHA256 (openresty-xss-nginx-module-v0.06_GH0.tar.gz) = 0b12bbc53a41f3e3d6df419c173b8c87434be3e6cd255a8193aa91345a2de6cf
 SIZE (openresty-xss-nginx-module-v0.06_GH0.tar.gz) = 12448
-SHA256 (tokers-zstd-nginx-module-f4ba115_GH0.tar.gz) = 20045e8ac80e2cc9fd3659573153cb1f22d98a653a10fe939a4be0e90160826a
-SIZE (tokers-zstd-nginx-module-f4ba115_GH0.tar.gz) = 55848
diff --git a/www/freenginx/files/extra-patch-zstd-empty-flush b/www/freenginx/files/extra-patch-zstd-empty-flush
deleted file mode 100644
index 58d96477d8a4..000000000000
--- a/www/freenginx/files/extra-patch-zstd-empty-flush
+++ /dev/null
@@ -1,41 +0,0 @@
---- ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c.orig
-+++ ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c
-@@ -460,6 +460,38 @@
-     }
- 
-     if (ngx_buf_size(ctx->out_buf) == 0) {
-+
-+        if (rc == 0 && ctx->flush) {
-+
-+            /*
-+             * nothing to flush: pass an empty flush buf downstream,
-+             * as the gzip filter does; otherwise ctx->flush is never
-+             * reset and the body filter loops forever
-+             */
-+
-+            b = ngx_calloc_buf(r->pool);
-+            if (b == NULL) {
-+                return NGX_ERROR;
-+            }
-+
-+            b->flush = 1;
-+
-+            cl = ngx_alloc_chain_link(r->pool);
-+            if (cl == NULL) {
-+                return NGX_ERROR;
-+            }
-+
-+            cl->buf = b;
-+            cl->next = NULL;
-+
-+            *ctx->last_out = cl;
-+            ctx->last_out = &cl->next;
-+
-+            ctx->flush = 0;
-+
-+            r->connection->buffered &= ~NGX_HTTP_GZIP_BUFFERED;
-+        }
-+
-         return NGX_AGAIN;
-     }
- 
diff --git a/www/freenginx/files/extra-patch-zstd-full-outbuf b/www/freenginx/files/extra-patch-zstd-full-outbuf
deleted file mode 100644
index 9e6a83e87cfb..000000000000
--- a/www/freenginx/files/extra-patch-zstd-full-outbuf
+++ /dev/null
@@ -1,18 +0,0 @@
---- ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c.orig
-+++ ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c
-@@ -462,7 +462,14 @@
- 
-         /* pending to call the ZSTD_endStream() */
- 
--        return NGX_AGAIN;
-+        if (ctx->buffer_out.pos < ctx->buffer_out.size) {
-+            return NGX_AGAIN;
-+        }
-+
-+        /*
-+         * the output buffer is full: pass it downstream now, otherwise
-+         * ngx_http_zstd_filter_get_buf() replaces it and the data is lost
-+         */
- 
-     } else {
-         ctx->action = NGX_HTTP_ZSTD_FILTER_COMPRESS; /* restore */
diff --git a/www/freenginx/files/extra-patch-zstd-last-truncation b/www/freenginx/files/extra-patch-zstd-last-truncation
deleted file mode 100644
index bb3f8fc34004..000000000000
--- a/www/freenginx/files/extra-patch-zstd-last-truncation
+++ /dev/null
@@ -1,60 +0,0 @@
---- ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c.orig
-+++ ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c
-@@ -390,6 +390,7 @@
- {
-     size_t        rc, pos_in, pos_out;
-     char         *hint;
-+    ngx_uint_t    end;
-     ngx_chain_t  *cl;
-     ngx_buf_t    *b;
- 
-@@ -440,6 +441,10 @@
-     ctx->out_buf->last += ctx->buffer_out.pos - pos_out;
-     ctx->redo = 0;
- 
-+    /* the frame is complete only when ZSTD_endStream() has flushed it all */
-+
-+    end = (rc == 0 && ctx->action == NGX_HTTP_ZSTD_FILTER_END);
-+
-     if (rc > 0) {
-         if (ctx->action == NGX_HTTP_ZSTD_FILTER_COMPRESS) {
-             ctx->action = NGX_HTTP_ZSTD_FILTER_FLUSH;
-@@ -447,7 +452,11 @@
- 
-         ctx->redo = 1;
- 
--    } else if (ctx->last && ctx->action != NGX_HTTP_ZSTD_FILTER_END) {
-+    } else if (ctx->last && ctx->action != NGX_HTTP_ZSTD_FILTER_END
-+               && ctx->buffer_in.pos == ctx->buffer_in.size)
-+    {
-+        /* end the frame only after the whole input has been consumed */
-+
-         ctx->redo = 1;
-         ctx->action = NGX_HTTP_ZSTD_FILTER_END;
- 
-@@ -502,13 +511,13 @@
- 
-     b = ctx->out_buf;
- 
--    if (rc == 0 && (ctx->flush || ctx->last)) {
-+    if (rc == 0 && (ctx->flush || end)) {
-         r->connection->buffered &= ~NGX_HTTP_GZIP_BUFFERED;
- 
-         b->flush = ctx->flush;
--        b->last_buf = ctx->last;
-+        b->last_buf = end;
- 
--        ctx->done = ctx->last;
-+        ctx->done = end;
-         ctx->flush = 0;
-     }
- 
-@@ -522,7 +531,7 @@
- 
-     ngx_memzero(&ctx->buffer_out, sizeof(ZSTD_outBuffer));
- 
--    return ctx->last && rc == 0 ? NGX_OK : NGX_AGAIN;
-+    return end ? NGX_OK : NGX_AGAIN;
- }
- 
- 
diff --git a/www/nginx-devel/Makefile b/www/nginx-devel/Makefile
index 1b1483e723a1..04bf3a47dabf 100644
--- a/www/nginx-devel/Makefile
+++ b/www/nginx-devel/Makefile
@@ -1,7 +1,7 @@
 PORTNAME?=	nginx
 PORTVERSION=	${NGINX_VERSION}
 .include "version.mk"
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	www
 MASTER_SITES=	https://nginx.org/download/
 PKGNAMESUFFIX?=	-devel
@@ -362,6 +362,11 @@ pre-configure-FORMINPUT-on:
 	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-form-input ${WRKSRC_forminput}
 	@${CHMOD} -R u+w ${WRKSRC_forminput}
 
+pre-configure-LET-on:
+	@${RM} -rf ${WRKSRC_let}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-let ${WRKSRC_let}
+	@${CHMOD} -R u+w ${WRKSRC_let}
+
 pre-configure-LUA-on:
 	@${RM} -rf ${WRKSRC_lua}
 	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-lua ${WRKSRC_lua}
@@ -378,11 +383,26 @@ pre-configure-NJS-on:
 	@${CHMOD} -R u+w ${WRKSRC_njs}
 	@${CHMOD} u+x ${WRKSRC_njs}/configure
 
+pre-configure-SLOWFS_CACHE-on:
+	@${RM} -rf ${WRKSRC_slowfs_cache}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-slowfs-cache ${WRKSRC_slowfs_cache}
+	@${CHMOD} -R u+w ${WRKSRC_slowfs_cache}
+
 pre-configure-VOD-on:
 	@${RM} -rf ${WRKSRC_vod}
 	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-vod ${WRKSRC_vod}
 	@${CHMOD} -R u+w ${WRKSRC_vod}
 
+pre-configure-WEBSOCKIFY-on:
+	@${RM} -rf ${WRKSRC_websockify}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-websockify ${WRKSRC_websockify}
+	@${CHMOD} -R u+w ${WRKSRC_websockify}
+
+pre-configure-ZSTD-on:
+	@${RM} -rf ${WRKSRC_zstd}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-zstd ${WRKSRC_zstd}
+	@${CHMOD} -R u+w ${WRKSRC_zstd}
+
 do-configure-NJS-on:
 	( cd ${WRKSRC_njs} && ${SETENV} ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${NJS_CONFIGURE_ARGS} )
 
diff --git a/www/nginx-devel/Makefile.extmod b/www/nginx-devel/Makefile.extmod
index 6b21c2cfd3f5..159b279af44f 100644
--- a/www/nginx-devel/Makefile.extmod
+++ b/www/nginx-devel/Makefile.extmod
@@ -206,7 +206,8 @@ ICONV_GH_TUPLE=		calio:iconv-nginx-module:v0.14:iconv
 ICONV_VARS=		DSO_EXTMODS+=iconv
 ICONV_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-calio-iconv-nginx-module-config
 
-LET_GH_TUPLE=		baysao:nginx-let-module:c1f23aa:let
+LET_BUILD_DEPENDS=	nginx-module-let>0:www/nginx-module-let
+WRKSRC_let=		${WRKDIR}/nginx-let-module
 LET_VARS=		DSO_EXTMODS+=let
 
 LUA_IMPLIES=		DEVEL_KIT
@@ -322,7 +323,8 @@ SFLOW_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_sflow_config.c \
 SHIBBOLETH_GH_TUPLE=	nginx-shib:nginx-http-shibboleth:629ae1f:shibboleth
 SHIBBOLETH_VARS=	DSO_EXTMODS+=shibboleth
 
-SLOWFS_CACHE_GH_TUPLE=	baysao:ngx_slowfs_cache:d011a18:slowfs_cache
+SLOWFS_CACHE_BUILD_DEPENDS=	nginx-module-slowfs-cache>0:www/nginx-module-slowfs-cache
+WRKSRC_slowfs_cache=	${WRKDIR}/nginx-slowfs-cache-module
 SLOWFS_CACHE_VARS=	DSO_EXTMODS+=slowfs_cache
 
 SRCACHE_GH_TUPLE=	openresty:srcache-nginx-module:bcdcfdc:srcache
@@ -346,14 +348,13 @@ XSS_GH_TUPLE=		openresty:xss-nginx-module:de2d87a:xss
 XSS_VARS=		DSO_EXTMODS+=xss
 XSS_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-xss-nginx-module-config
 
-WEBSOCKIFY_GH_TUPLE=	tg123:websockify-nginx-module:c11bc9a:websockify
+WEBSOCKIFY_BUILD_DEPENDS=	nginx-module-websockify>0:www/nginx-module-websockify
+WRKSRC_websockify=	${WRKDIR}/nginx-websockify-module
 WEBSOCKIFY_VARS=	DSO_EXTMODS+=websockify
 
 ZSTD_LIB_DEPENDS=	libzstd.so:archivers/zstd
 ZSTD_CONFIGURE_ENV=	ZSTD_INC=${LOCALBASE}/include \
 			ZSTD_LIB=${LOCALBASE}/lib
-ZSTD_GH_TUPLE=		tokers:zstd-nginx-module:f4ba115:zstd
+ZSTD_BUILD_DEPENDS=	nginx-module-zstd>0:www/nginx-module-zstd
+WRKSRC_zstd=		${WRKDIR}/nginx-zstd-module
 ZSTD_VARS=		DSO_EXTMODS+=zstd
-ZSTD_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-zstd-empty-flush \
-			${PATCHDIR}/extra-patch-zstd-last-truncation \
-			${PATCHDIR}/extra-patch-zstd-full-outbuf
diff --git a/www/nginx-devel/distinfo b/www/nginx-devel/distinfo
index ac439071e495..00466ff667ed 100644
--- a/www/nginx-devel/distinfo
+++ b/www/nginx-devel/distinfo
@@ -79,8 +79,6 @@ SHA256 (evanmiller-mod_zip-a9f9afa_GH0.tar.gz) = 645035b7d7a83ab3f47c692386e85be
 SIZE (evanmiller-mod_zip-a9f9afa_GH0.tar.gz) = 30917
 SHA256 (calio-iconv-nginx-module-v0.14_GH0.tar.gz) = b8b9f355c05c0790226512f6732348a2404d48531688a1fc04ce6768163bf462
 SIZE (calio-iconv-nginx-module-v0.14_GH0.tar.gz) = 13133
-SHA256 (baysao-nginx-let-module-c1f23aa_GH0.tar.gz) = 7393809d5d8877812da1bd5b5fbd1d8b00bc85e71f2f387c344f007773e49050
-SIZE (baysao-nginx-let-module-c1f23aa_GH0.tar.gz) = 20617
 SHA256 (Taymindis-nginx-link-function-3.2.4_GH0.tar.gz) = 20c3679199ba7efe1598f03b2fa0b13591226363c8dd7930d7f02702cd5abada
 SIZE (Taymindis-nginx-link-function-3.2.4_GH0.tar.gz) = 139656
 SHA256 (openresty-memc-nginx-module-v0.20_GH0.tar.gz) = a42dd56dd6e2144755a127bcd2a6cc1a488258dc5cdb751d6a3e5dd5b6989239
@@ -111,17 +109,11 @@ SHA256 (sflow-nginx-sflow-module-f15c87f_GH0.tar.gz) = 251de3a5b588a4721effe88f3
 SIZE (sflow-nginx-sflow-module-f15c87f_GH0.tar.gz) = 29515
 SHA256 (nginx-shib-nginx-http-shibboleth-629ae1f_GH0.tar.gz) = 79d3d8330c58254605e569bb34371c030122ad2f52e0191cbf06df3bc316952c
 SIZE (nginx-shib-nginx-http-shibboleth-629ae1f_GH0.tar.gz) = 23907
-SHA256 (baysao-ngx_slowfs_cache-d011a18_GH0.tar.gz) = 6ae8abb01a2aff788e75ec68621cb0159148a6f73730a84b30b0bdbc6cdc1758
-SIZE (baysao-ngx_slowfs_cache-d011a18_GH0.tar.gz) = 11186
 SHA256 (openresty-srcache-nginx-module-bcdcfdc_GH0.tar.gz) = fbe15bc0c2d52f778b04d4433e220f219bde0660d19c6acedf67aa194049b130
 SIZE (openresty-srcache-nginx-module-bcdcfdc_GH0.tar.gz) = 50848
 SHA256 (vozlt-nginx-module-sts-3c10d42_GH0.tar.gz) = 748b67ceb82b3b843ae915bf7863fd08b7c2427c045e5ec540242d050f7b30d0
 SIZE (vozlt-nginx-module-sts-3c10d42_GH0.tar.gz) = 352431
 SHA256 (vozlt-nginx-module-vts-c382342_GH0.tar.gz) = 1252c7fe0636d658172055d7e2598487479a54adc00e90af6b23ddb4b6641952
 SIZE (vozlt-nginx-module-vts-c382342_GH0.tar.gz) = 184988
-SHA256 (tg123-websockify-nginx-module-c11bc9a_GH0.tar.gz) = aca454bffcee2476dc92682ebfb8c0378a271fda178be7e945d648419d220758
-SIZE (tg123-websockify-nginx-module-c11bc9a_GH0.tar.gz) = 14646
 SHA256 (openresty-xss-nginx-module-de2d87a_GH0.tar.gz) = f830c9300d751046e2592c74d09f39ac4b4b4567078c96c24951de5554861b5e
 SIZE (openresty-xss-nginx-module-de2d87a_GH0.tar.gz) = 12779
-SHA256 (tokers-zstd-nginx-module-f4ba115_GH0.tar.gz) = 20045e8ac80e2cc9fd3659573153cb1f22d98a653a10fe939a4be0e90160826a
-SIZE (tokers-zstd-nginx-module-f4ba115_GH0.tar.gz) = 55848
diff --git a/www/nginx-devel/files/extra-patch-zstd-empty-flush b/www/nginx-devel/files/extra-patch-zstd-empty-flush
deleted file mode 100644
index 58d96477d8a4..000000000000
--- a/www/nginx-devel/files/extra-patch-zstd-empty-flush
+++ /dev/null
@@ -1,41 +0,0 @@
---- ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c.orig
-+++ ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c
-@@ -460,6 +460,38 @@
-     }
- 
-     if (ngx_buf_size(ctx->out_buf) == 0) {
-+
-+        if (rc == 0 && ctx->flush) {
-+
-+            /*
-+             * nothing to flush: pass an empty flush buf downstream,
-+             * as the gzip filter does; otherwise ctx->flush is never
-+             * reset and the body filter loops forever
-+             */
-+
-+            b = ngx_calloc_buf(r->pool);
-+            if (b == NULL) {
-+                return NGX_ERROR;
-+            }
-+
-+            b->flush = 1;
-+
-+            cl = ngx_alloc_chain_link(r->pool);
-+            if (cl == NULL) {
-+                return NGX_ERROR;
-+            }
-+
-+            cl->buf = b;
-+            cl->next = NULL;
-+
-+            *ctx->last_out = cl;
-+            ctx->last_out = &cl->next;
-+
-+            ctx->flush = 0;
-+
-+            r->connection->buffered &= ~NGX_HTTP_GZIP_BUFFERED;
-+        }
-+
-         return NGX_AGAIN;
-     }
- 
diff --git a/www/nginx-devel/files/extra-patch-zstd-full-outbuf b/www/nginx-devel/files/extra-patch-zstd-full-outbuf
deleted file mode 100644
index 9e6a83e87cfb..000000000000
--- a/www/nginx-devel/files/extra-patch-zstd-full-outbuf
+++ /dev/null
@@ -1,18 +0,0 @@
---- ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c.orig
-+++ ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c
-@@ -462,7 +462,14 @@
- 
-         /* pending to call the ZSTD_endStream() */
- 
--        return NGX_AGAIN;
-+        if (ctx->buffer_out.pos < ctx->buffer_out.size) {
-+            return NGX_AGAIN;
-+        }
-+
-+        /*
-+         * the output buffer is full: pass it downstream now, otherwise
-+         * ngx_http_zstd_filter_get_buf() replaces it and the data is lost
-+         */
- 
-     } else {
-         ctx->action = NGX_HTTP_ZSTD_FILTER_COMPRESS; /* restore */
diff --git a/www/nginx-devel/files/extra-patch-zstd-last-truncation b/www/nginx-devel/files/extra-patch-zstd-last-truncation
deleted file mode 100644
index bb3f8fc34004..000000000000
--- a/www/nginx-devel/files/extra-patch-zstd-last-truncation
+++ /dev/null
@@ -1,60 +0,0 @@
---- ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c.orig
-+++ ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c
-@@ -390,6 +390,7 @@
- {
-     size_t        rc, pos_in, pos_out;
-     char         *hint;
-+    ngx_uint_t    end;
-     ngx_chain_t  *cl;
-     ngx_buf_t    *b;
- 
-@@ -440,6 +441,10 @@
-     ctx->out_buf->last += ctx->buffer_out.pos - pos_out;
-     ctx->redo = 0;
- 
-+    /* the frame is complete only when ZSTD_endStream() has flushed it all */
-+
-+    end = (rc == 0 && ctx->action == NGX_HTTP_ZSTD_FILTER_END);
-+
-     if (rc > 0) {
-         if (ctx->action == NGX_HTTP_ZSTD_FILTER_COMPRESS) {
-             ctx->action = NGX_HTTP_ZSTD_FILTER_FLUSH;
-@@ -447,7 +452,11 @@
- 
-         ctx->redo = 1;
- 
--    } else if (ctx->last && ctx->action != NGX_HTTP_ZSTD_FILTER_END) {
-+    } else if (ctx->last && ctx->action != NGX_HTTP_ZSTD_FILTER_END
-+               && ctx->buffer_in.pos == ctx->buffer_in.size)
-+    {
-+        /* end the frame only after the whole input has been consumed */
-+
-         ctx->redo = 1;
-         ctx->action = NGX_HTTP_ZSTD_FILTER_END;
- 
-@@ -502,13 +511,13 @@
- 
-     b = ctx->out_buf;
- 
--    if (rc == 0 && (ctx->flush || ctx->last)) {
-+    if (rc == 0 && (ctx->flush || end)) {
-         r->connection->buffered &= ~NGX_HTTP_GZIP_BUFFERED;
- 
-         b->flush = ctx->flush;
--        b->last_buf = ctx->last;
-+        b->last_buf = end;
- 
--        ctx->done = ctx->last;
-+        ctx->done = end;
-         ctx->flush = 0;
-     }
- 
-@@ -522,7 +531,7 @@
- 
-     ngx_memzero(&ctx->buffer_out, sizeof(ZSTD_outBuffer));
- 
--    return ctx->last && rc == 0 ? NGX_OK : NGX_AGAIN;
-+    return end ? NGX_OK : NGX_AGAIN;
- }
- 
- 
diff --git a/www/nginx/Makefile b/www/nginx/Makefile
index fba12b91ac42..8ab8fb43f440 100644
--- a/www/nginx/Makefile
+++ b/www/nginx/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	nginx
 PORTVERSION=	${NGINX_VERSION}
 .include "version.mk"
-PORTREVISION=	3
+PORTREVISION=	4
 PORTEPOCH=	3
 CATEGORIES=	www
 MASTER_SITES=	https://nginx.org/download/ \
@@ -355,6 +355,11 @@ pre-configure-FORMINPUT-on:
 	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-form-input ${WRKSRC_forminput}
 	@${CHMOD} -R u+w ${WRKSRC_forminput}
 
+pre-configure-LET-on:
+	@${RM} -rf ${WRKSRC_let}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-let ${WRKSRC_let}
+	@${CHMOD} -R u+w ${WRKSRC_let}
+
 pre-configure-LUA-on:
 	@${RM} -rf ${WRKSRC_lua}
 	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-lua ${WRKSRC_lua}
@@ -371,11 +376,26 @@ pre-configure-NJS-on:
 	@${CHMOD} -R u+w ${WRKSRC_njs}
 	@${CHMOD} u+x ${WRKSRC_njs}/configure
 
+pre-configure-SLOWFS_CACHE-on:
+	@${RM} -rf ${WRKSRC_slowfs_cache}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-slowfs-cache ${WRKSRC_slowfs_cache}
+	@${CHMOD} -R u+w ${WRKSRC_slowfs_cache}
+
 pre-configure-VOD-on:
 	@${RM} -rf ${WRKSRC_vod}
 	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-vod ${WRKSRC_vod}
 	@${CHMOD} -R u+w ${WRKSRC_vod}
 
+pre-configure-WEBSOCKIFY-on:
+	@${RM} -rf ${WRKSRC_websockify}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-websockify ${WRKSRC_websockify}
+	@${CHMOD} -R u+w ${WRKSRC_websockify}
+
+pre-configure-ZSTD-on:
+	@${RM} -rf ${WRKSRC_zstd}
+	@${CP} -R ${LOCALBASE}/share/nginx/modules/nginx-module-zstd ${WRKSRC_zstd}
+	@${CHMOD} -R u+w ${WRKSRC_zstd}
+
 do-configure-NJS-on:
 	( cd ${WRKSRC_njs} && ${SETENV} ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${NJS_CONFIGURE_ARGS} )
 
diff --git a/www/nginx/Makefile.extmod b/www/nginx/Makefile.extmod
index a7adaa8ecae1..e77a3b96b8b2 100644
--- a/www/nginx/Makefile.extmod
+++ b/www/nginx/Makefile.extmod
@@ -204,7 +204,8 @@ ICONV_GH_TUPLE=		calio:iconv-nginx-module:v0.14:iconv
 ICONV_VARS=		DSO_EXTMODS+=iconv
 ICONV_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-calio-iconv-nginx-module-config
 
-LET_GH_TUPLE=		baysao:nginx-let-module:c1f23aa:let
+LET_BUILD_DEPENDS=	nginx-module-let>0:www/nginx-module-let
+WRKSRC_let=		${WRKDIR}/nginx-let-module
 LET_VARS=		DSO_EXTMODS+=let
 
 LUA_IMPLIES=		DEVEL_KIT
@@ -317,7 +318,8 @@ SFLOW_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_sflow_config.c \
 SHIBBOLETH_GH_TUPLE=	nginx-shib:nginx-http-shibboleth:be12df5:shibboleth
 SHIBBOLETH_VARS=	DSO_EXTMODS+=shibboleth
 
-SLOWFS_CACHE_GH_TUPLE=	baysao:ngx_slowfs_cache:d011a18:slowfs_cache
+SLOWFS_CACHE_BUILD_DEPENDS=	nginx-module-slowfs-cache>0:www/nginx-module-slowfs-cache
+WRKSRC_slowfs_cache=	${WRKDIR}/nginx-slowfs-cache-module
 SLOWFS_CACHE_VARS=	DSO_EXTMODS+=slowfs_cache
 
 SRCACHE_GH_TUPLE=	openresty:srcache-nginx-module:be22ac0:srcache
@@ -341,14 +343,13 @@ XSS_GH_TUPLE=		openresty:xss-nginx-module:v0.06:xss
 XSS_VARS=		DSO_EXTMODS+=xss
 XSS_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-xss-nginx-module-config
 
-WEBSOCKIFY_GH_TUPLE=	tg123:websockify-nginx-module:c11bc9a:websockify
+WEBSOCKIFY_BUILD_DEPENDS=	nginx-module-websockify>0:www/nginx-module-websockify
+WRKSRC_websockify=	${WRKDIR}/nginx-websockify-module
 WEBSOCKIFY_VARS=	DSO_EXTMODS+=websockify
 
 ZSTD_LIB_DEPENDS=	libzstd.so:archivers/zstd
 ZSTD_CONFIGURE_ENV=	ZSTD_INC=${LOCALBASE}/include \
 			ZSTD_LIB=${LOCALBASE}/lib
-ZSTD_GH_TUPLE=		tokers:zstd-nginx-module:f4ba115:zstd
+ZSTD_BUILD_DEPENDS=	nginx-module-zstd>0:www/nginx-module-zstd
+WRKSRC_zstd=		${WRKDIR}/nginx-zstd-module
 ZSTD_VARS=		DSO_EXTMODS+=zstd
-ZSTD_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-zstd-empty-flush \
-			${PATCHDIR}/extra-patch-zstd-last-truncation \
-			${PATCHDIR}/extra-patch-zstd-full-outbuf
diff --git a/www/nginx/distinfo b/www/nginx/distinfo
index 068e9f570986..db6476ef4ce2 100644
--- a/www/nginx/distinfo
+++ b/www/nginx/distinfo
@@ -77,8 +77,6 @@ SHA256 (evanmiller-mod_zip-a9f9afa_GH0.tar.gz) = 645035b7d7a83ab3f47c692386e85be
 SIZE (evanmiller-mod_zip-a9f9afa_GH0.tar.gz) = 30917
 SHA256 (calio-iconv-nginx-module-v0.14_GH0.tar.gz) = b8b9f355c05c0790226512f6732348a2404d48531688a1fc04ce6768163bf462
 SIZE (calio-iconv-nginx-module-v0.14_GH0.tar.gz) = 13133
-SHA256 (baysao-nginx-let-module-c1f23aa_GH0.tar.gz) = 7393809d5d8877812da1bd5b5fbd1d8b00bc85e71f2f387c344f007773e49050
-SIZE (baysao-nginx-let-module-c1f23aa_GH0.tar.gz) = 20617
 SHA256 (Taymindis-nginx-link-function-3.2.4_GH0.tar.gz) = 20c3679199ba7efe1598f03b2fa0b13591226363c8dd7930d7f02702cd5abada
 SIZE (Taymindis-nginx-link-function-3.2.4_GH0.tar.gz) = 139656
 SHA256 (openresty-memc-nginx-module-v0.19_GH0.tar.gz) = 8c2bdbe875e4f5225d0778bfb09a2668f9281d7de6218c7b462a7ba2cee06fe8
@@ -107,17 +105,11 @@ SHA256 (sflow-nginx-sflow-module-543c72a_GH0.tar.gz) = 95efdb1f6cfd6c32c577707f6
 SIZE (sflow-nginx-sflow-module-543c72a_GH0.tar.gz) = 29504
 SHA256 (nginx-shib-nginx-http-shibboleth-be12df5_GH0.tar.gz) = aff9830b5de78dd9ce32cd2c55c5cf9173c99fe1a1d2190407c96668e7517bab
 SIZE (nginx-shib-nginx-http-shibboleth-be12df5_GH0.tar.gz) = 23872
-SHA256 (baysao-ngx_slowfs_cache-d011a18_GH0.tar.gz) = 6ae8abb01a2aff788e75ec68621cb0159148a6f73730a84b30b0bdbc6cdc1758
-SIZE (baysao-ngx_slowfs_cache-d011a18_GH0.tar.gz) = 11186
 SHA256 (openresty-srcache-nginx-module-be22ac0_GH0.tar.gz) = 5753d1ffe87b5d6f5b7a0696667bb5ff1388738136fdee26ba55bc33f5796061
 SIZE (openresty-srcache-nginx-module-be22ac0_GH0.tar.gz) = 51029
 SHA256 (vozlt-nginx-module-sts-3c10d42_GH0.tar.gz) = 748b67ceb82b3b843ae915bf7863fd08b7c2427c045e5ec540242d050f7b30d0
 SIZE (vozlt-nginx-module-sts-3c10d42_GH0.tar.gz) = 352431
 SHA256 (vozlt-nginx-module-vts-bf64dbf_GH0.tar.gz) = d2782c75e39cb2ecf68453922b43ab2295adb6a35fa6a0f9c14173f70d22d7b1
 SIZE (vozlt-nginx-module-vts-bf64dbf_GH0.tar.gz) = 180394
-SHA256 (tg123-websockify-nginx-module-c11bc9a_GH0.tar.gz) = aca454bffcee2476dc92682ebfb8c0378a271fda178be7e945d648419d220758
-SIZE (tg123-websockify-nginx-module-c11bc9a_GH0.tar.gz) = 14646
 SHA256 (openresty-xss-nginx-module-v0.06_GH0.tar.gz) = 0b12bbc53a41f3e3d6df419c173b8c87434be3e6cd255a8193aa91345a2de6cf
 SIZE (openresty-xss-nginx-module-v0.06_GH0.tar.gz) = 12448
-SHA256 (tokers-zstd-nginx-module-f4ba115_GH0.tar.gz) = 20045e8ac80e2cc9fd3659573153cb1f22d98a653a10fe939a4be0e90160826a
-SIZE (tokers-zstd-nginx-module-f4ba115_GH0.tar.gz) = 55848
diff --git a/www/nginx/files/extra-patch-zstd-empty-flush b/www/nginx/files/extra-patch-zstd-empty-flush
deleted file mode 100644
index 58d96477d8a4..000000000000
--- a/www/nginx/files/extra-patch-zstd-empty-flush
+++ /dev/null
@@ -1,41 +0,0 @@
---- ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c.orig
-+++ ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c
-@@ -460,6 +460,38 @@
-     }
- 
-     if (ngx_buf_size(ctx->out_buf) == 0) {
-+
-+        if (rc == 0 && ctx->flush) {
-+
-+            /*
-+             * nothing to flush: pass an empty flush buf downstream,
-+             * as the gzip filter does; otherwise ctx->flush is never
-+             * reset and the body filter loops forever
-+             */
-+
-+            b = ngx_calloc_buf(r->pool);
-+            if (b == NULL) {
-+                return NGX_ERROR;
-+            }
-+
-+            b->flush = 1;
-+
-+            cl = ngx_alloc_chain_link(r->pool);
-+            if (cl == NULL) {
-+                return NGX_ERROR;
-+            }
-+
-+            cl->buf = b;
-+            cl->next = NULL;
-+
-+            *ctx->last_out = cl;
-+            ctx->last_out = &cl->next;
-+
-+            ctx->flush = 0;
-+
-+            r->connection->buffered &= ~NGX_HTTP_GZIP_BUFFERED;
-+        }
-+
-         return NGX_AGAIN;
-     }
- 
diff --git a/www/nginx/files/extra-patch-zstd-full-outbuf b/www/nginx/files/extra-patch-zstd-full-outbuf
deleted file mode 100644
index 9e6a83e87cfb..000000000000
--- a/www/nginx/files/extra-patch-zstd-full-outbuf
+++ /dev/null
@@ -1,18 +0,0 @@
---- ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c.orig
-+++ ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c
-@@ -462,7 +462,14 @@
- 
-         /* pending to call the ZSTD_endStream() */
- 
--        return NGX_AGAIN;
-+        if (ctx->buffer_out.pos < ctx->buffer_out.size) {
-+            return NGX_AGAIN;
-+        }
-+
-+        /*
-+         * the output buffer is full: pass it downstream now, otherwise
-+         * ngx_http_zstd_filter_get_buf() replaces it and the data is lost
-+         */
- 
-     } else {
-         ctx->action = NGX_HTTP_ZSTD_FILTER_COMPRESS; /* restore */
diff --git a/www/nginx/files/extra-patch-zstd-last-truncation b/www/nginx/files/extra-patch-zstd-last-truncation
deleted file mode 100644
index bb3f8fc34004..000000000000
--- a/www/nginx/files/extra-patch-zstd-last-truncation
+++ /dev/null
@@ -1,60 +0,0 @@
---- ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c.orig
-+++ ../zstd-nginx-module-f4ba115/filter/ngx_http_zstd_filter_module.c
-@@ -390,6 +390,7 @@
- {
-     size_t        rc, pos_in, pos_out;
-     char         *hint;
-+    ngx_uint_t    end;
-     ngx_chain_t  *cl;
-     ngx_buf_t    *b;
- 
-@@ -440,6 +441,10 @@
-     ctx->out_buf->last += ctx->buffer_out.pos - pos_out;
-     ctx->redo = 0;
- 
-+    /* the frame is complete only when ZSTD_endStream() has flushed it all */
-+
-+    end = (rc == 0 && ctx->action == NGX_HTTP_ZSTD_FILTER_END);
-+
-     if (rc > 0) {
-         if (ctx->action == NGX_HTTP_ZSTD_FILTER_COMPRESS) {
-             ctx->action = NGX_HTTP_ZSTD_FILTER_FLUSH;
-@@ -447,7 +452,11 @@
- 
-         ctx->redo = 1;
- 
--    } else if (ctx->last && ctx->action != NGX_HTTP_ZSTD_FILTER_END) {
-+    } else if (ctx->last && ctx->action != NGX_HTTP_ZSTD_FILTER_END
-+               && ctx->buffer_in.pos == ctx->buffer_in.size)
-+    {
-+        /* end the frame only after the whole input has been consumed */
-+
-         ctx->redo = 1;
-         ctx->action = NGX_HTTP_ZSTD_FILTER_END;
- 
-@@ -502,13 +511,13 @@
- 
-     b = ctx->out_buf;
- 
--    if (rc == 0 && (ctx->flush || ctx->last)) {
-+    if (rc == 0 && (ctx->flush || end)) {
-         r->connection->buffered &= ~NGX_HTTP_GZIP_BUFFERED;
- 
-         b->flush = ctx->flush;
--        b->last_buf = ctx->last;
-+        b->last_buf = end;
- 
--        ctx->done = ctx->last;
-+        ctx->done = end;
-         ctx->flush = 0;
-     }
- 
-@@ -522,7 +531,7 @@
- 
-     ngx_memzero(&ctx->buffer_out, sizeof(ZSTD_outBuffer));
- 
--    return ctx->last && rc == 0 ? NGX_OK : NGX_AGAIN;
-+    return end ? NGX_OK : NGX_AGAIN;
- }
- 
-