git: 5bc5cf658253 - main - www/nginx-module-cache-purge: Fix proxy_cache_purge on freenginx
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 07 Sep 2026 14:47:03 UTC
The branch main has been updated by joneum:
URL: https://cgit.FreeBSD.org/ports/commit/?id=5bc5cf65825359d49fa54f5d7e7e46bd0a52557e
commit 5bc5cf65825359d49fa54f5d7e7e46bd0a52557e
Author: Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2026-09-07 14:46:12 +0000
Commit: Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2026-09-07 14:46:55 +0000
www/nginx-module-cache-purge: Fix proxy_cache_purge on freenginx
The module mirrors ngx_http_proxy_loc_conf_t privately and enables the
host_set field for nginx_version >= 1029004. freenginx does not have
that field, so plcf->cache_key is read at the wrong offset and a PURGE
request kills the worker process.
Sponsored by: Netzkommune GmbH
---
www/freenginx/Makefile | 2 +-
www/nginx-module-cache-purge/Makefile | 1 +
.../files/patch-ngx__cache__purge__module.c | 11 +++++++++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/www/freenginx/Makefile b/www/freenginx/Makefile
index a4d8fd1e0ebd..b1997a99fc2c 100644
--- a/www/freenginx/Makefile
+++ b/www/freenginx/Makefile
@@ -1,7 +1,7 @@
PORTNAME= freenginx
PORTVERSION= ${NGINX_VERSION}
.include "version.mk"
-PORTREVISION?= 11
+PORTREVISION?= 12
CATEGORIES= www
MASTER_SITES= https://freenginx.org/download/ \
LOCAL/joneum
diff --git a/www/nginx-module-cache-purge/Makefile b/www/nginx-module-cache-purge/Makefile
index 05495c9da3d0..f1a2b2ea91e9 100644
--- a/www/nginx-module-cache-purge/Makefile
+++ b/www/nginx-module-cache-purge/Makefile
@@ -1,5 +1,6 @@
PORTNAME= nginx-module-cache-purge
DISTVERSION= 3.0.2
+PORTREVISION= 1
CATEGORIES= www
MAINTAINER= joneum@FreeBSD.org
diff --git a/www/nginx-module-cache-purge/files/patch-ngx__cache__purge__module.c b/www/nginx-module-cache-purge/files/patch-ngx__cache__purge__module.c
new file mode 100644
index 000000000000..2490f1ee2939
--- /dev/null
+++ b/www/nginx-module-cache-purge/files/patch-ngx__cache__purge__module.c
@@ -0,0 +1,11 @@
+--- ngx_cache_purge_module.c.orig 2026-05-05 11:30:59 UTC
++++ ngx_cache_purge_module.c
+@@ -1789,7 +1789,7 @@ typedef struct {
+ ngx_array_t *headers_source;
+ /* FIX (#52): nginx 1.29.4 inserted host_set here — without this guard
+ * every subsequent field is at the wrong offset, causing a segfault. */
+-# if (nginx_version >= 1029004)
++# if (nginx_version >= 1029004) && !defined(freenginx)
+ ngx_uint_t host_set;
+ # endif
+ # if (nginx_version < 8040)