summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/Makefile1
-rw-r--r--www/freenginx-devel/Makefile383
-rw-r--r--www/freenginx-devel/Makefile.extmod336
-rw-r--r--www/freenginx-devel/Makefile.options.desc118
-rw-r--r--www/freenginx-devel/distinfo5
-rw-r--r--www/freenginx-devel/files/extra-patch-calio-iconv-nginx-module-config19
-rw-r--r--www/freenginx-devel/files/extra-patch-naxsi-libinjection__sqli_c13
-rw-r--r--www/freenginx-devel/files/extra-patch-naxsi_config26
-rw-r--r--www/freenginx-devel/files/extra-patch-nginx-ct-LibreSSL20
-rw-r--r--www/freenginx-devel/files/extra-patch-nginx-http-footer-filter-config12
-rw-r--r--www/freenginx-devel/files/extra-patch-nginx-link-function-config42
-rw-r--r--www/freenginx-devel/files/extra-patch-nginx-notice-config13
-rw-r--r--www/freenginx-devel/files/extra-patch-nginx-thumbextractor-module-config25
-rw-r--r--www/freenginx-devel/files/extra-patch-nginx_mogilefs_module-config13
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_brotli_filter_config41
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_http_auth_ldap_module.c10
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_http_dav_ext_module.c15
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_http_json_status_module-config12
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_http_mogilefs_module.c12
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_http_notice_module.c11
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_http_redis_module.c34
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_http_sflow_config.c10
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_http_sflow_config.h11
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_http_sflow_module.c59
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_http_tarantool-config24
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_http_uploadprogress_module.c73
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_link_func_module.c11
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_postgres-config19
-rw-r--r--www/freenginx-devel/files/extra-patch-ngx_stream_ssl_ct_module.c14
-rw-r--r--www/freenginx-devel/files/extra-patch-openresty-drizzle-nginx-module-config42
-rw-r--r--www/freenginx-devel/files/extra-patch-passenger-build-nginx.rb33
-rw-r--r--www/freenginx-devel/files/extra-patch-passenger-disable-telemetry11
-rw-r--r--www/freenginx-devel/files/extra-patch-passenger_src_nginx__module_Configuration.c27
-rw-r--r--www/freenginx-devel/files/extra-patch-rds-csv-nginx-module-config15
-rw-r--r--www/freenginx-devel/files/extra-patch-rds-json-nginx-module-config15
-rw-r--r--www/freenginx-devel/files/extra-patch-spnego-http-auth-nginx-module-config14
-rw-r--r--www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_hash_module.c44
-rw-r--r--www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_ip_hash_module.c28
-rw-r--r--www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_least_conn_module.c46
-rw-r--r--www/freenginx-devel/files/extra-patch-src-http-ngx_http_upstream_round_robin.c101
-rw-r--r--www/freenginx-devel/files/extra-patch-src-http-ngx_http_upstream_round_robin.h14
-rw-r--r--www/freenginx-devel/files/extra-patch-src_http_modules_ngx_http_slice_read_ahead.c456
-rw-r--r--www/freenginx-devel/files/extra-patch-stream-lua-nginx-module_config10
-rw-r--r--www/freenginx-devel/files/extra-patch-xss-nginx-module-config15
-rw-r--r--www/freenginx-devel/files/nginx.in158
-rw-r--r--www/freenginx-devel/files/patch-conf-nginx.conf47
-rw-r--r--www/freenginx-devel/files/pkg-message.in25
-rw-r--r--www/freenginx-devel/pkg-descr8
-rw-r--r--www/freenginx-devel/pkg-plist106
49 files changed, 2597 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile
index f55aaae2d51a..c7fbd6a8d8af 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -185,6 +185,7 @@
SUBDIR += foswiki
SUBDIR += free-sa-devel
SUBDIR += freenginx
+ SUBDIR += freenginx-devel
SUBDIR += fswiki
SUBDIR += fusionpbx
SUBDIR += g-cows
diff --git a/www/freenginx-devel/Makefile b/www/freenginx-devel/Makefile
new file mode 100644
index 000000000000..533f7a605ed8
--- /dev/null
+++ b/www/freenginx-devel/Makefile
@@ -0,0 +1,383 @@
+PORTNAME= freenginx
+PORTVERSION= 1.27.1
+PORTREVISION?= 0
+CATEGORIES= www
+MASTER_SITES= https://freenginx.org/download/ \
+ LOCAL/joneum
+PKGNAMESUFFIX= -devel
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
+
+MAINTAINER?= joneum@FreeBSD.org
+COMMENT?= Robust and small WWW server
+WWW= https://nginx.com/
+
+LICENSE?= BSD2CLAUSE
+LICENSE_FILE?= ${WRKSRC}/LICENSE
+
+CONFLICTS_INSTALL= nginx
+
+PORTSCOUT= limit:^1\.2[7-8]\.[0-9]*
+
+USES= cpe
+
+CPE_VENDOR= freenginx
+CPE_PRODUCT= freenginx
+USE_GITHUB= nodefault
+
+NGINX_VARDIR?= /var
+NGINX_LOGDIR?= ${NGINX_VARDIR}/log/nginx
+NGINX_RUNDIR?= ${NGINX_VARDIR}/run
+NGINX_TMPDIR?= ${NGINX_VARDIR}/tmp/nginx
+HTTP_PORT?= 80
+
+NGINX_ACCESSLOG?= ${NGINX_LOGDIR}/access.log
+NGINX_ERRORLOG?= ${NGINX_LOGDIR}/error.log
+
+CONFLICTS?= nginx-1.* \
+ nginx-full-1.* \
+ nginx-lite-1.* \
+ nginx-naxsi-1.*
+USE_RC_SUBR?= nginx
+SUB_FILES?= pkg-message
+SUB_LIST+= WWWOWN=${WWWOWN} \
+ WWWGRP=${WWWGRP} \
+ NGINX_RUNDIR=${NGINX_RUNDIR} \
+ NGINX_TMPDIR=${NGINX_TMPDIR} \
+ PREFIX=${PREFIX}
+
+HAS_CONFIGURE= yes
+CONFIGURE_ARGS+=--prefix=${ETCDIR} \
+ --with-cc-opt="-I ${LOCALBASE}/include" \
+ --conf-path=${ETCDIR}/nginx.conf \
+ --sbin-path=${PREFIX}/sbin/nginx \
+ --pid-path=${NGINX_RUNDIR}/nginx.pid \
+ --error-log-path=${NGINX_ERRORLOG} \
+ --user=${WWWOWN} --group=${WWWGRP} \
+ --with-compat \
+ --with-pcre
+ALL_TARGET=
+
+PLIST_SUB+= NGINX_TMPDIR=${NGINX_TMPDIR} NGINX_LOGDIR=${NGINX_LOGDIR} WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
+
+USERS?= ${WWWOWN}
+GROUPS?=${WWWGRP}
+
+NO_OPTIONS_SORT= yes
+
+OPTIONS_GROUP= HTTPGRP MAILGRP STREAMGRP
+# Modules that are part of the base nginx distribution
+OPTIONS_GROUP_HTTPGRP= GOOGLE_PERFTOOLS HTTP HTTP_ADDITION HTTP_AUTH_REQ \
+ HTTP_CACHE HTTP_DAV HTTP_DEGRADATION HTTP_FLV HTTP_GUNZIP_FILTER \
+ HTTP_GZIP_STATIC HTTP_IMAGE_FILTER HTTP_MP4 HTTP_PERL \
+ HTTP_RANDOM_INDEX HTTP_REALIP HTTP_SECURE_LINK HTTP_SLICE HTTP_SSL \
+ HTTP_STATUS HTTP_SUB HTTP_XSLT HTTPV2 HTTPV3 HTTPV3_BORING HTTPV3_LSSL \
+ HTTPV3_QTLS
+
+OPTIONS_GROUP_MAILGRP= MAIL MAIL_IMAP MAIL_POP3 MAIL_SMTP MAIL_SSL
+
+OPTIONS_GROUP_STREAMGRP= STREAM STREAM_REALIP STREAM_SSL \
+ STREAM_SSL_PREREAD
+
+OPTIONS_DEFINE= DEBUG DEBUGLOG DSO FILE_AIO IPV6 NJS NJS_XML OTEL THREADS WWW
+OPTIONS_DEFAULT?= DSO FILE_AIO HTTP HTTP_ADDITION HTTP_AUTH_REQ HTTP_CACHE \
+ HTTP_DAV HTTP_FLV HTTP_GUNZIP_FILTER HTTP_GZIP_STATIC HTTP_MP4 \
+ HTTP_RANDOM_INDEX HTTP_REALIP HTTP_SECURE_LINK HTTP_SLICE HTTP_SSL \
+ HTTP_STATUS HTTP_SUB HTTPV2 HTTPV3 MAIL MAIL_SSL STREAM \
+ STREAM_REALIP STREAM_SSL STREAM_SSL_PREREAD THREADS WWW
+
+LIB_DEPENDS+= libpcre2-8.so:devel/pcre2
+
+OPTIONS_RADIO+= GSSAPI
+OPTIONS_RADIO_GSSAPI= GSSAPI_HEIMDAL GSSAPI_MIT
+GSSAPI_HEIMDAL_USES= gssapi:heimdal,flags
+GSSAPI_MIT_USES= gssapi:mit
+
+OPTIONS_SUB= yes
+
+.include "Makefile.options.desc"
+
+.for opt in ${OPTIONS_GROUP_MAILGRP:NMAIL}
+${opt}_IMPLIES= MAIL
+.endfor
+
+.for opt in ${OPTIONS_GROUP_HTTPGRP:NHTTP} WWW
+${opt}_IMPLIES= HTTP
+.endfor
+
+.for opt in ${OPTIONS_GROUP_STREAMGRP:NSTREAM}
+${opt}_IMPLIES= STREAM
+.endfor
+
+GSSAPI_HEIMDAL_IMPLIES= HTTP_AUTH_KRB5
+GSSAPI_MIT_IMPLIES= HTTP_AUTH_KRB5
+
+# If the target is makesum, make sure that every distfile is fetched.
+.if ${.TARGETS:Mmakesum}
+OPTIONS_DEFAULT= ${OPTIONS_DEFINE} ${OPTIONS_GROUP_HTTPGRP} \
+ ${OPTIONS_GROUP_MAILGRP} ${OPTIONS_GROUP_STREAMGRP} \
+ ${OPTIONS_GROUP_THIRDPARTYGRP}
+.endif
+
+# Non-module options handling
+DEBUG_CFLAGS= -g
+DEBUG_VARS= STRIP=#do not strip if nginx with debug information
+DEBUGLOG_CONFIGURE_ON= --with-debug
+DSO_CONFIGURE_ON= --modules-path=${MODULESDIR}
+DSO_VARS= MODULESDIR=${PREFIX}/libexec/${PORTNAME}
+FILE_AIO_CONFIGURE_ON= --with-file-aio
+IPV6_CONFIGURE_OFF= --with-cc-opt="-DNGX_HAVE_INET6=0 -I ${LOCALBASE}/include"
+THREADS_CONFIGURE_ON= --with-threads
+
+# Bundled modules
+GOOGLE_PERFTOOLS_LIB_DEPENDS= libprofiler.so:devel/google-perftools
+GOOGLE_PERFTOOLS_CONFIGURE_ON= --with-google_perftools_module
+HTTP_CONFIGURE_ON= --http-client-body-temp-path=${NGINX_TMPDIR}/client_body_temp \
+ --http-fastcgi-temp-path=${NGINX_TMPDIR}/fastcgi_temp \
+ --http-proxy-temp-path=${NGINX_TMPDIR}/proxy_temp \
+ --http-scgi-temp-path=${NGINX_TMPDIR}/scgi_temp \
+ --http-uwsgi-temp-path=${NGINX_TMPDIR}/uwsgi_temp \
+ --http-log-path=${NGINX_ACCESSLOG}
+HTTP_CONFIGURE_OFF= --without-http
+HTTP_ADDITION_CONFIGURE_ON= --with-http_addition_module
+HTTP_AUTH_REQ_CONFIGURE_ON= --with-http_auth_request_module
+HTTP_CACHE_CONFIGURE_OFF= --without-http-cache
+HTTP_DAV_CONFIGURE_ON= --with-http_dav_module
+HTTP_DEGRADATION_CONFIGURE_ON= --with-http_degradation_module
+HTTP_FLV_CONFIGURE_ON= --with-http_flv_module
+HTTP_GZIP_STATIC_CONFIGURE_ON= --with-http_gzip_static_module
+HTTP_GUNZIP_FILTER_CONFIGURE_ON=--with-http_gunzip_module
+HTTP_IMAGE_FILTER_LIB_DEPENDS= libgd.so:graphics/gd
+HTTP_IMAGE_FILTER_VARS= DSO_BASEMODS+=http_image_filter_module
+HTTP_MP4_CONFIGURE_ON= --with-http_mp4_module
+HTTP_PERL_CATEGORIES= perl5
+HTTP_PERL_USES= perl5
+# Fix build failure on clang >= 12
+HTTP_PERL_CFLAGS= -Wno-compound-token-split-by-macro
+HTTP_PERL_VARS= DSO_BASEMODS+=http_perl_module
+HTTP_RANDOM_INDEX_CONFIGURE_ON= --with-http_random_index_module
+HTTP_REALIP_CONFIGURE_ON= --with-http_realip_module
+HTTP_SECURE_LINK_CONFIGURE_ON= --with-http_secure_link_module
+HTTP_SLICE_CONFIGURE_ON= --with-http_slice_module
+HTTP_SSL_CONFIGURE_ON= --with-http_ssl_module
+HTTP_SSL_USES= ssl
+HTTP_STATUS_CONFIGURE_ON= --with-http_stub_status_module
+HTTP_SUB_CONFIGURE_ON= --with-http_sub_module
+HTTP_XSLT_CONFIGURE_ON= --with-http_xslt_module
+HTTP_XSLT_LIB_DEPENDS= libxml2.so:textproc/libxml2 \
+ libxslt.so:textproc/libxslt
+HTTP_XSLT_VARS= DSO_BASEMODS+=http_xslt_module
+HTTPV2_IMPLIES= HTTP_SSL
+HTTPV2_CONFIGURE_ON= --with-http_v2_module
+HTTPV3_CONFIGURE_ON= --with-http_v3_module
+HTTPV3_BORING_BUILD_DEPENDS= ${LOCALBASE}/bin/bssl:security/boringssl
+HTTPV3_BORING_RUN_DEPENDS= ${LOCALBASE}/bin/bssl:security/boringssl
+HTTPV3_BORING_IMPLIES= HTTPV3
+HTTPV3_BORING_PREVENTS= HTTPV3_LSSL HTTPV3_QTLS
+HTTPV3_LSSL_BUILD_DEPENDS= ${LOCALBASE}/include/tls.h:security/libressl-devel
+HTTPV3_LSSL_BUILD_DEPENDS= ${LOCALBASE}/include/tls.h:security/libressl-devel
+HTTPV3_LSSL_IMPLIES= HTTPV3
+HTTPV3_LSSL_PREVENTS= HTTPV3_BORING HTTPV3_QTLS
+HTTPV3_QTLS_BUILD_DEPENDS= ${LOCALBASE}/include/openssl/quic.h:security/openssl-quictls
+HTTPV3_QTLS_RUN_DEPENDS= ${LOCALBASE}/include/openssl/quic.h:security/openssl-quictls
+HTTPV3_QTLS_IMPLIES= HTTPV3
+HTTPV3_QTLS_PREVENTS= HTTPV3_BORING HTTPV3_LSSL
+MAIL_VARS= DSO_BASEMODS+=mail
+MAIL_IMAP_CONFIGURE_OFF= --without-mail_imap_module
+MAIL_POP3_CONFIGURE_OFF= --without-mail_pop3_module
+MAIL_SMTP_CONFIGURE_OFF= --without-mail_smtp_module
+MAIL_SSL_USES= ssl
+MAIL_SSL_CONFIGURE_ON= --with-mail_ssl_module
+STREAM_VARS= DSO_BASEMODS+=stream
+STREAM_CONFIGURE_ON= --with-stream
+STREAM_REALIP_CONFIGURE_ON= --with-stream_realip_module
+STREAM_SSL_USES= ssl
+STREAM_SSL_CONFIGURE_ON= --with-stream_ssl_module
+STREAM_SSL_PREREAD_CONFIGURE_ON=--with-stream_ssl_preread_module
+
+### External modules
+.include "Makefile.extmod"
+
+.include <bsd.port.pre.mk>
+
+.if ${PORT_OPTIONS:MDSO}
+_addbasemod= =dynamic
+_addextmod= add-dynamic-module
+.else
+_addextmod= add-module
+.endif
+
+.for mod in ${DSO_BASEMODS}
+CONFIGURE_ARGS+= --with-${mod}${_addbasemod}
+.endfor
+
+# Some modules depend on other being there before, for example, devel_kit needs
+# to be there before a few other.
+.for mod in ${FIRST_DSO_EXTMODS}
+CONFIGURE_ARGS+= --${_addextmod}=${WRKSRC_${mod}}${${mod:tu}_SUBDIR}
+.endfor
+
+.for mod in ${DSO_EXTMODS}
+CONFIGURE_ARGS+= --${_addextmod}=${WRKSRC_${mod}}${${mod:tu}_SUBDIR}
+.endfor
+# For non-GitHub hosted modules
+.for moddir in ${DSO_EXTDIRS}
+CONFIGURE_ARGS+= --${_addextmod}=${WRKDIR}/${moddir}
+.endfor
+
+.if empty(PORT_OPTIONS:MHTTP) && empty(PORT_OPTIONS:MMAIL)
+IGNORE= requires at least HTTP or MAIL to \
+ be defined. Please do 'make config' again
+.endif
+
+.if ${PORT_OPTIONS:MHTTP_AUTH_KRB5} && (empty(PORT_OPTIONS:MGSSAPI_HEIMDAL) && empty(PORT_OPTIONS:MGSSAPI_MIT))
+IGNORE= required at least GSSAPI_HEIMDAL or \
+ GSSAPI_MIT to be defined. Please do \
+ 'make config' again
+.endif
+
+.if ${PORT_OPTIONS:MPASSENGER} && empty(PORT_OPTIONS:MDEBUG)
+CONFIGURE_ENV+= OPTIMIZE="yes"
+CFLAGS+= -DNDEBUG
+.endif
+
+.if ${PORT_OPTIONS:MPASSENGER}
+CONFIGURE_ENV+= EXTRA_PRE_CXXFLAGS="-std=c++14"
+.endif
+
+.if empty(PORT_OPTIONS:MMODSECURITY3)
+CONFIGURE_ARGS+= --with-ld-opt="-L ${LOCALBASE}/lib"
+.else
+CONFIGURE_ARGS+= --with-ld-opt="-L ${LOCALBASE}/lib -lpcre"
+LIB_DEPENDS+= libpcre.so:devel/pcre
+.endif
+
+.if ${PORT_OPTIONS:MNJS} && empty(PORT_OPTIONS:MNJS_XML)
+CONFIGURE_ENV+= NJS_LIBXSLT=NO
+NJS_CONFIGURE_ARGS= --no-libxml2
+.endif
+
+pre-everything::
+ @${ECHO_MSG}
+.if ${PORT_OPTIONS:MHTTP_UPSTREAM_FAIR}
+ @${ECHO_MSG} "Enable http_ssl module to build upstream_fair with SSL support"
+.endif
+.if ${PORT_OPTIONS:MPASSENGER}
+ @${ECHO_MSG} "This port install Passenger module only"
+.endif
+ @${ECHO_MSG}
+
+post-extract-NAXSI-on:
+ @${RMDIR} ${WRKSRC_naxsi}/naxsi_src/libinjection
+ @${LN} -s ${WRKSRC_libinjection} ${WRKSRC_naxsi}/naxsi_src/libinjection
+
+pre-patch-HTTPV3-on:
+ @${MV} ${WRKSRC}/README ${WRKSRC}/README.1st
+
+post-patch:
+ @${REINPLACE_CMD} 's!%%HTTP_PORT%%!${HTTP_PORT}!; \
+ s!%%PREFIX%%!${PREFIX}!; \
+ s!%%NGINX_ERRORLOG%%!${NGINX_ERRORLOG}!' \
+ ${WRKSRC}/conf/nginx.conf
+
+post-patch-BROTLI-on:
+ @${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_brotli}/filter/config
+
+post-patch-DRIZZLE-on:
+ @${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_drizzle}/config
+
+post-patch-FASTDFS-on:
+ @${REINPLACE_CMD} \
+ 's!%%PREFIX%%!${PREFIX}!g;s!%%LOCALBASE%%!${LOCALBASE}!g' \
+ ${WRKSRC_fastdfs}/src/config
+
+post-patch-GRIDFS-on:
+ @${REINPLACE_CMD} 's!\/usr!${LOCALBASE}!g' \
+ ${WRKSRC_gridfs}/nginx-gridfs/config
+
+post-patch-HTTP_AUTH_KRB5-on:
+ @${REINPLACE_CMD} 's!%%GSSAPILIBS%%!${GSSAPILIBS}!g; \
+ s!%%GSSAPIINCDIR%%!${GSSAPIINCDIR}!g; \
+ s!%%GSSAPILIBDIR%%!${GSSAPILIBDIR}!g' ${WRKSRC_auth_krb5}/config
+
+post-patch-HTTP_TARANTOOL-on:
+ @${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_nginx_tarantool}/config
+
+post-patch-ICONV-on:
+ @${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_iconv}/config
+
+post-patch-PASSENGER-on:
+ @${REINPLACE_CMD} \
+ '168,170s!true!false!' \
+ ${WRKSRC_PASSENGER}/build/basics.rb
+ @${REINPLACE_CMD} \
+ 's!-I/usr/include/libev!!; \
+ s!-lev!!; \
+ s!-Iext/libev!!; \
+ s!-I/usr/include/libeio!!; \
+ s!-leio!!; \
+ s!-Iext/libeio!!' \
+ ${WRKSRC_PASSENGER}/build/common_library.rb
+
+post-patch-POSTGRES-on:
+ @${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_postgres}/config
+
+post-patch-SFLOW-on:
+ @${REINPLACE_CMD} \
+ 's!%%PREFIX%%!${LOCALBASE}!g' \
+ ${WRKSRC_sflow}/ngx_http_sflow_config.h
+
+pre-configure-SMALL_LIGHT-on:
+ ( cd ${WRKSRC_small_light} && ./setup )
+
+do-configure-NJS-on:
+ ( cd ${WRKSRC_njs} && ${SETENV} ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${NJS_CONFIGURE_ARGS} )
+
+.if !target(do-install)
+do-install:
+ ${MKDIR} ${STAGEDIR}${ETCDIR}
+ ${MKDIR} ${STAGEDIR}${NGINX_TMPDIR}
+ ${MKDIR} ${STAGEDIR}${NGINX_LOGDIR}
+ ${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${STAGEDIR}${PREFIX}/sbin
+.for i in koi-utf koi-win win-utf
+ ${INSTALL_DATA} ${WRKSRC}/conf/${i} ${STAGEDIR}${ETCDIR}
+.endfor
+.for i in fastcgi_params mime.types scgi_params uwsgi_params
+ ${INSTALL_DATA} ${WRKSRC}/conf/${i} ${STAGEDIR}${ETCDIR}/${i}-dist
+.endfor
+
+do-install-HTTP_PERL-on:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/nginx
+ ${INSTALL_PROGRAM} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so \
+ ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/nginx
+ ${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \
+ ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/
+
+# Install dynamic modules
+do-install-DSO-on:
+ ${MKDIR} ${STAGEDIR}${MODULESDIR}
+ (cd ${WRKSRC}/objs/ && ${FIND} . -name '*.so' -maxdepth 1 -type f \
+ -exec ${INSTALL_PROGRAM} {} ${STAGEDIR}${MODULESDIR} \;)
+
+do-install-LINK-on:
+ ${INSTALL_DATA} ${WRKSRC_link}/src/ngx_link_func_module.h ${STAGEDIR}${PREFIX}/include
+
+do-install-NAXSI-on:
+ ${INSTALL_DATA} \
+ ${WRKDIR}/naxsi-${NAXSI_NGINX_VER}/naxsi_rules/naxsi_core.rules \
+ ${STAGEDIR}${ETCDIR}
+.endif
+
+.if !target(post-install)
+post-install:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/share/vim/vimfiles
+ cd ${WRKSRC}/contrib/vim && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/share/vim/vimfiles
+ ${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${STAGEDIR}${PREFIX}/share/man/man8
+ ${CAT} ${WRKSRC}/conf/nginx.conf >> ${STAGEDIR}${ETCDIR}/nginx.conf-dist
+
+post-install-WWW-on:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/www/nginx-dist
+ (cd ${WRKSRC}/html && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/www/nginx-dist && \
+ ${TOUCH} ${STAGEDIR}${PREFIX}/www/nginx-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING)
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/www/freenginx-devel/Makefile.extmod b/www/freenginx-devel/Makefile.extmod
new file mode 100644
index 000000000000..5ef8e27b7226
--- /dev/null
+++ b/www/freenginx-devel/Makefile.extmod
@@ -0,0 +1,336 @@
+### External modules
+
+OPTIONS_GROUP+= THIRDPARTYGRP
+# External modules (arrayvar MUST appear after devel_kit for build-dep)
+OPTIONS_GROUP_THIRDPARTYGRP= AJP AWS_AUTH BROTLI CACHE_PURGE CT \
+ DEVEL_KIT ARRAYVAR DRIZZLE DYNAMIC_UPSTREAM ECHO ENCRYPTSESSION \
+ FIPS_CHECK FORMINPUT GRIDFS HEADERS_MORE HTTP_ACCEPT_LANGUAGE HTTP_AUTH_DIGEST \
+ HTTP_AUTH_KRB5 HTTP_AUTH_LDAP HTTP_AUTH_PAM HTTP_DAV_EXT HTTP_EVAL \
+ HTTP_FANCYINDEX HTTP_FOOTER HTTP_GEOIP2 HTTP_IP2LOCATION HTTP_IP2PROXY \
+ HTTP_JSON_STATUS HTTP_MOGILEFS HTTP_NOTICE HTTP_PUSH \
+ HTTP_PUSH_STREAM HTTP_REDIS HTTP_SLICE_AHEAD HTTP_SUBS_FILTER HTTP_TARANTOOL \
+ HTTP_UPLOAD HTTP_UPLOAD_PROGRESS HTTP_UPSTREAM_CHECK HTTP_UPSTREAM_FAIR \
+ HTTP_UPSTREAM_STICKY HTTP_VIDEO_THUMBEXTRACTOR HTTP_ZIP ICONV LET LINK LUA \
+ LUASTREAM MEMC MODSECURITY3 NAXSI PASSENGER POSTGRES RDS_CSV RDS_JSON \
+ REDIS2 RTMP SET_MISC SFLOW SHIBBOLETH SLOWFS_CACHE SRCACHE STS \
+ VOD VTS XSS WEBSOCKIFY ZSTD
+
+AJP_GH_TUPLE= msva:nginx_ajp_module:fcbb2cc:ajp
+AJP_VARS= DSO_EXTMODS+=ajp
+
+ARRAYVAR_IMPLIES= DEVEL_KIT
+ARRAYVAR_GH_TUPLE= openresty:array-var-nginx-module:v0.05:arrayvar
+ARRAYVAR_VARS= DSO_EXTMODS+=arrayvar
+
+AWS_AUTH_GH_TUPLE= anomalizer:ngx_aws_auth:21931b2:aws_auth
+AWS_AUTH_VARS= DSO_EXTMODS+=aws_auth
+
+BROTLI_LIB_DEPENDS= libbrotlicommon.so:archivers/brotli
+BROTLI_GH_TUPLE= google:ngx_brotli:a71f931:brotli
+BROTLI_VARS= DSO_EXTMODS+=brotli
+BROTLI_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_brotli_filter_config
+
+CACHE_PURGE_GH_TUPLE= nginx-modules:ngx_cache_purge:a84b0f3:cache_purge
+CACHE_PURGE_VARS= DSO_EXTMODS+=cache_purge
+
+CT_IMPLIES= HTTP_SSL
+CT_GH_TUPLE= grahamedgecombe:nginx-ct:93e9884:ct
+CT_VARS= DSO_EXTMODS+=ct
+CT_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-nginx-ct-LibreSSL \
+ ${PATCHDIR}/extra-patch-ngx_stream_ssl_ct_module.c
+
+ECHO_GH_TUPLE= openresty:echo-nginx-module:5a402aa:echo
+ECHO_VARS= DSO_EXTMODS+=echo
+
+DRIZZLE_LIB_DEPENDS= libdrizzle.so:databases/libdrizzle
+DRIZZLE_CONFIGURE_ENV= LIBDRIZZLE_INC=${LOCALBASE}/include \
+ LIBDRIZZLE_LIB=${LOCALBASE}/lib
+DRIZZLE_GH_TUPLE= openresty:drizzle-nginx-module:3504fc6:drizzle
+DRIZZLE_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-openresty-drizzle-nginx-module-config
+DRIZZLE_VARS= DSO_EXTMODS+=drizzle
+
+DYNAMIC_UPSTREAM_IMPLIES= STREAM
+DYNAMIC_UPSTREAM_GH_TUPLE= ZigzagAK:ngx_dynamic_upstream:960eef2:dynamic_upstream
+DYNAMIC_UPSTREAM_VARS= DSO_EXTMODS+=dynamic_upstream
+
+DEVEL_KIT_GH_TUPLE= vision5:ngx_devel_kit:v0.3.3:devel_kit
+DEVEL_KIT_VARS= FIRST_DSO_EXTMODS+=devel_kit
+
+ENCRYPTSESSION_IMPLIES= DEVEL_KIT
+ENCRYPTSESSION_GH_TUPLE= openresty:encrypted-session-nginx-module:v0.09:encryptsession
+ENCRYPTSESSION_VARS= DSO_EXTMODS+=encryptsession
+
+FIPS_CHECK_GH_TUPLE= ogarrett:nginx-fips-check-module:6cb4270:fipscheck
+FIPS_CHECK_VARS= DSO_EXTMODS+=fipscheck
+
+FORMINPUT_IMPLIES= DEVEL_KIT
+FORMINPUT_GH_TUPLE= calio:form-input-nginx-module:v0.12:forminput
+FORMINPUT_VARS= DSO_EXTMODS+=forminput
+
+GRIDFS_GH_TUPLE= nieoding:nginx-gridfs:059bdc3:gridfs
+GRIDFS_LIB_DEPENDS= libbson-1.0.so:devel/libbson \
+ libmongoc-1.0.so:devel/mongo-c-driver
+GRIDFS_VARS= DSO_EXTMODS+=gridfs GRIDFS_SUBDIR=/nginx-gridfs
+
+HEADERS_MORE_GH_TUPLE= openresty:headers-more-nginx-module:06dc0be:headers_more
+HEADERS_MORE_VARS= DSO_EXTMODS+=headers_more
+
+HTTP_ACCEPT_LANGUAGE_GH_TUPLE= dvershinin:nginx_accept_language_module:5683967:accept_language
+HTTP_ACCEPT_LANGUAGE_VARS= DSO_EXTMODS+=accept_language
+
+HTTP_AUTH_DIGEST_GH_TUPLE= atomx:nginx-http-auth-digest:274490c:auth_digest
+HTTP_AUTH_DIGEST_VARS= DSO_EXTMODS+=auth_digest
+
+HTTP_AUTH_KRB5_GH_TUPLE= stnoonan:spnego-http-auth-nginx-module:3575542:auth_krb5
+HTTP_AUTH_KRB5_VARS= DSO_EXTMODS+=auth_krb5
+HTTP_AUTH_KRB5_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-spnego-http-auth-nginx-module-config
+
+HTTP_AUTH_LDAP_GH_TUPLE= kvspb:nginx-auth-ldap:83c059b:http_auth_ldap
+HTTP_AUTH_LDAP_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_auth_ldap_module.c
+HTTP_AUTH_LDAP_VARS= DSO_EXTMODS+=http_auth_ldap
+HTTP_AUTH_LDAP_USES= ldap
+
+HTTP_AUTH_PAM_GH_TUPLE= sto:ngx_http_auth_pam_module:v1.5.3:auth_pam
+HTTP_AUTH_PAM_VARS= DSO_EXTMODS+=auth_pam
+
+HTTP_DAV_EXT_IMPLIES= HTTP_DAV
+HTTP_DAV_EXT_LIB_DEPENDS= libxml2.so:textproc/libxml2 \
+ libxslt.so:textproc/libxslt
+HTTP_DAV_EXT_GH_TUPLE= arut:nginx-dav-ext-module:v3.0.0:dav_ext
+HTTP_DAV_EXT_VARS= DSO_EXTMODS+=dav_ext
+HTTP_DAV_EXT_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_dav_ext_module.c
+
+HTTP_EVAL_GH_TUPLE= openresty:nginx-eval-module:582bd25:eval
+HTTP_EVAL_VARS= DSO_EXTMODS+=eval
+
+HTTP_FANCYINDEX_GH_TUPLE= aperezdc:ngx-fancyindex:v0.5.2:fancyindex
+HTTP_FANCYINDEX_VARS= DSO_EXTMODS+=fancyindex
+
+HTTP_FOOTER_GH_TUPLE= alibaba:nginx-http-footer-filter:1.2.2:footer
+HTTP_FOOTER_VARS= DSO_EXTMODS+=footer
+HTTP_FOOTER_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-nginx-http-footer-filter-config
+
+HTTP_GEOIP2_GH_TUPLE= leev:ngx_http_geoip2_module:3.4:geoip2
+HTTP_GEOIP2_CFLAGS= -I${LOCALBASE}/include
+HTTP_GEOIP2_VARS= DSO_EXTMODS+=geoip2
+HTTP_GEOIP2_LIB_DEPENDS= libmaxminddb.so:net/libmaxminddb
+
+HTTP_IP2LOCATION_GH_TUPLE= ip2location:ip2location-nginx:2df35fb:ip2location
+HTTP_IP2LOCATION_LIB_DEPENDS= libIP2Location.so:net/ip2location
+HTTP_IP2LOCATION_VARS= DSO_EXTMODS+=ip2location
+
+HTTP_IP2PROXY_GH_TUPLE= ip2location:ip2proxy-nginx:02ce447:ip2proxy
+HTTP_IP2PROXY_LIB_DEPENDS= libIP2Proxy.so:net/ip2proxy
+HTTP_IP2PROXY_VARS= DSO_EXTMODS+=ip2proxy
+
+HTTP_JSON_STATUS_GH_TUPLE= nginx-modules:ngx_http_json_status_module:1d2f303:json_status
+HTTP_JSON_STATUS_VARS= DSO_EXTMODS+=json_status
+HTTP_JSON_STATUS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_json_status_module-config
+
+HTTP_MOGILEFS_MASTER_SITES= http://www.grid.net.ru/nginx/download/:mogilefs
+HTTP_MOGILEFS_DISTFILES= nginx_mogilefs_module-1.0.4.tar.gz:mogilefs
+HTTP_MOGILEFS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_mogilefs_module.c \
+ ${PATCHDIR}/extra-patch-nginx_mogilefs_module-config
+HTTP_MOGILEFS_VARS= DSO_EXTDIRS+=nginx_mogilefs_module-1.0.4
+
+HTTP_NOTICE_GH_TUPLE= kr:nginx-notice:3c95966:notice
+HTTP_NOTICE_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_notice_module.c \
+ ${PATCHDIR}/extra-patch-nginx-notice-config
+HTTP_NOTICE_VARS= DSO_EXTMODS+=notice
+
+HTTP_PUSH_GH_TUPLE= slact:nchan:v1.3.6:push
+HTTP_PUSH_VARS= DSO_EXTMODS+=push
+
+HTTP_PUSH_STREAM_GH_TUPLE= wandenberg:nginx-push-stream-module:8c02220:pushstream
+HTTP_PUSH_STREAM_VARS= DSO_EXTMODS+=pushstream
+
+HTTP_REDIS_MASTER_SITES= LOCAL/osa:redis
+HTTP_REDIS_DISTFILES= ngx_http_redis-0.3.9.tar.gz:redis
+HTTP_REDIS_VARS= DSO_EXTDIRS+=ngx_http_redis-0.3.9
+HTTP_REDIS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_redis_module.c
+
+HTTP_SLICE_AHEAD_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src_http_modules_ngx_http_slice_read_ahead.c
+
+HTTP_SUBS_FILTER_GH_TUPLE= yaoweibin:ngx_http_substitutions_filter_module:c6f825f:subs_filter
+HTTP_SUBS_FILTER_VARS= DSO_EXTMODS+=subs_filter
+
+HTTP_TARANTOOL_LIB_DEPENDS= libmsgpuck.so:devel/msgpuck \
+ libyajl.so:devel/yajl
+HTTP_TARANTOOL_GH_TUPLE= tarantool:nginx_upstream_module:aeb8696:nginx_tarantool
+HTTP_TARANTOOL_VARS= DSO_EXTMODS+=nginx_tarantool
+HTTP_TARANTOOL_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_tarantool-config
+
+HTTP_UPLOAD_GH_TUPLE= fdintino:nginx-upload-module:643b4c1:upload
+HTTP_UPLOAD_VARS= DSO_EXTMODS+=upload
+
+HTTP_UPLOAD_PROGRESS_GH_TUPLE= masterzen:nginx-upload-progress-module:68b3ab3:uploadprogress
+HTTP_UPLOAD_PROGRESS_VARS= DSO_EXTMODS+=uploadprogress
+HTTP_UPLOAD_PROGRESS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_uploadprogress_module.c
+
+HTTP_UPSTREAM_CHECK_GH_TUPLE= yaoweibin:nginx_upstream_check_module:9aecf15:upstreamcheck
+HTTP_UPSTREAM_CHECK_CONFIGURE_ON= --add-module=${WRKSRC_upstreamcheck}
+HTTP_UPSTREAM_CHECK_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-http-modules-ngx_http_upstream_hash_module.c \
+ ${PATCHDIR}/extra-patch-src-http-modules-ngx_http_upstream_ip_hash_module.c \
+ ${PATCHDIR}/extra-patch-src-http-modules-ngx_http_upstream_least_conn_module.c \
+ ${PATCHDIR}/extra-patch-src-http-ngx_http_upstream_round_robin.c \
+ ${PATCHDIR}/extra-patch-src-http-ngx_http_upstream_round_robin.h
+
+HTTP_UPSTREAM_FAIR_GH_TUPLE= jaygooby:nginx-upstream-fair:10ecdcf:upstreamfair
+HTTP_UPSTREAM_FAIR_VARS= DSO_EXTMODS+=upstreamfair
+
+HTTP_UPSTREAM_STICKY_IMPLIES= HTTP_SSL
+HTTP_UPSTREAM_STICKY_GH_TUPLE= dvershinin:nginx-sticky-module-ng:2753211:upstreamsticky
+HTTP_UPSTREAM_STICKY_VARS= DSO_EXTMODS+=upstreamsticky
+
+HTTP_VIDEO_THUMBEXTRACTOR_LIB_DEPENDS= libavformat.so:multimedia/ffmpeg \
+ libavcodec.so:multimedia/ffmpeg \
+ libavutil.so:multimedia/ffmpeg \
+ libswscale.so:multimedia/ffmpeg
+HTTP_VIDEO_THUMBEXTRACTOR_USES= jpeg
+HTTP_VIDEO_THUMBEXTRACTOR_GH_TUPLE= wandenberg:nginx-video-thumbextractor-module:e81f850:vte
+HTTP_VIDEO_THUMBEXTRACTOR_VARS= DSO_EXTMODS+=vte
+HTTP_VIDEO_THUMBEXTRACTOR_EXTRA_PATCHES=${PATCHDIR}/extra-patch-nginx-thumbextractor-module-config
+
+HTTP_ZIP_GH_TUPLE= vince2678:mod_zip:5b2604b:mod_zip
+HTTP_ZIP_VARS= DSO_EXTMODS+=mod_zip
+
+ICONV_IMPLIES= DEVEL_KIT
+ICONV_USES= iconv
+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_VARS= DSO_EXTMODS+=let
+
+LUA_IMPLIES= DEVEL_KIT
+LUA_LIB_DEPENDS= libluajit-5.1.so:lang/luajit-openresty
+LUA_RUN_DEPENDS= lua-resty-core>0:www/lua-resty-core
+LUA_CONFIGURE_ENV= LUAJIT_INC=${LOCALBASE}/include/luajit-2.1 \
+ LUAJIT_LIB=${LOCALBASE}/lib
+LUA_GH_TUPLE= openresty:lua-nginx-module:v0.10.26:lua
+LUA_VARS= DSO_EXTMODS+=lua
+
+LUASTREAM_IMPLIES= DEVEL_KIT
+LUASTREAM_LIB_DEPENDS= libluajit-5.1.so:lang/luajit-openresty
+LUASTREAM_RUN_DEPENDS= lua-resty-core>0:www/lua-resty-core
+LUASTREAM_CONFIGURE_ENV=LUAJIT_INC=${LOCALBASE}/include/luajit-2.1 \
+ LUAJIT_LIB=${LOCALBASE}/lib
+LUASTREAM_GH_TUPLE= openresty:stream-lua-nginx-module:bea8a0c:luastream
+LUASTREAM_VARS= DSO_EXTMODS+=luastream
+LUASTREAM_EXTRA_PATCHES=${PATCHDIR}/extra-patch-stream-lua-nginx-module_config
+
+LINK_GH_TUPLE= Taymindis:nginx-link-function:3.2.4:link
+LINK_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-nginx-link-function-config \
+ ${PATCHDIR}/extra-patch-ngx_link_func_module.c
+LINK_VARS= DSO_EXTMODS+=link
+
+MEMC_GH_TUPLE= openresty:memc-nginx-module:v0.19:memc
+MEMC_VARS= DSO_EXTMODS+=memc
+
+MODSECURITY3_IMPLIES= HTTP_ADDITION HTTP_IMAGE_FILTER HTTP_GUNZIP_FILTER HTTP_XSLT
+MODSECURITY3_LIB_DEPENDS= libmodsecurity.so:security/modsecurity3
+MODSECURITY3_GH_TUPLE= SpiderLabs:ModSecurity-nginx:v1.0.3:modsecurity3
+MODSECURITY3_VARS= DSO_EXTMODS+=modsecurity3
+
+NAXSI_NGINX_VER= 1.6
+NAXSI_GH_TUPLE= wargio:naxsi:${NAXSI_NGINX_VER}:naxsi \
+ libinjection:libinjection:4aa3894:libinjection
+NAXSI_VARS= DSO_EXTMODS+=naxsi NAXSI_SUBDIR=/naxsi_src
+NAXSI_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-naxsi-libinjection__sqli_c \
+ ${PATCHDIR}/extra-patch-naxsi_config
+
+NJS_GH_TUPLE= nginx:njs:0.8.4:njs
+NJS_VARS= DSO_EXTMODS+=njs NJS_SUBDIR=/nginx
+NJS_IMPLIES= STREAM
+
+NJS_XML_IMPLIES= HTTP NJS
+NJS_XML_LIB_DEPENDS= libxml2.so:textproc/libxml2 \
+ libxslt.so:textproc/libxslt
+
+OTEL_GH_TUPLE= osokin:nginx-otel:8f0857d:otel
+OTEL_VARS= DSO_EXTMODS+=otel OTEL_SUBDIR=/
+OTEL_LIB_DEPENDS= libabsl_base.so:devel/abseil \
+ libcares.so:dns/c-ares \
+ libgrpc.so:devel/grpc \
+ libopentelemetry_common.so:devel/opentelemetry-cpp \
+ libprotobuf.so:devel/protobuf \
+ libre2.so:devel/re2
+OTEL_BUILD_DEPENDS= ${LOCALBASE}/include/opentelemetry/proto/common/v1/common.proto:devel/opentelemetry-proto
+OTEL_CONFIGURE_ENV+= NGX_OTEL_PROTO_DIR=${PREFIX}/include
+
+PASSENGER_NGINX_VER= 6.0.22
+PASSENGER_CATEGORIES= ruby
+PASSENGER_USES= ruby
+PASSENGER_BUILD_DEPENDS=${LOCALBASE}/bin/rake:devel/rubygem-rake
+PASSENGER_RAKE_BIN= ${LOCALBASE}/bin/rake
+PASSENGER_MASTER_SITES= https://s3.amazonaws.com/phusion-passenger/releases/:passenger
+PASSENGER_DISTFILES= passenger-${PASSENGER_NGINX_VER}.tar.gz:passenger
+PASSENGER_VARS= WRKSRC_passenger=${WRKDIR}/passenger-${PASSENGER_NGINX_VER} \
+ DSO_EXTDIRS+=passenger-${PASSENGER_NGINX_VER}/src/nginx_module
+PASSENGER_EXTRA_PATCHES=${PATCHDIR}/extra-patch-passenger-build-nginx.rb \
+ ${PATCHDIR}/extra-patch-passenger-disable-telemetry \
+ ${PATCHDIR}/extra-patch-passenger_src_nginx__module_Configuration.c
+
+POSTGRES_USES= pgsql
+POSTGRES_GH_TUPLE= konstruxi:ngx_postgres:8aa7359:postgres
+POSTGRES_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_postgres-config
+POSTGRES_VARS= DSO_EXTMODS+=postgres
+
+RDS_CSV_GH_TUPLE= openresty:rds-csv-nginx-module:v0.09:rdscsv
+RDS_CSV_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-rds-csv-nginx-module-config
+RDS_CSV_VARS= DSO_EXTMODS+=rdscsv
+
+RDS_JSON_GH_TUPLE= openresty:rds-json-nginx-module:v0.15:rdsjson
+RDS_JSON_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-rds-json-nginx-module-config
+RDS_JSON_VARS= DSO_EXTMODS+=rdsjson
+
+REDIS2_GH_TUPLE= openresty:redis2-nginx-module:v0.15:redis2
+REDIS2_VARS= DSO_EXTMODS+=redis2
+
+RTMP_GH_TUPLE= arut:nginx-rtmp-module:v1.2.2:rtmp
+RTMP_VARS= DSO_EXTMODS+=rtmp
+
+SET_MISC_IMPLIES= DEVEL_KIT
+SET_MISC_GH_TUPLE= openresty:set-misc-nginx-module:3937e7b:setmisc
+SET_MISC_VARS= DSO_EXTMODS+=setmisc
+
+SFLOW_GH_TUPLE= sflow:nginx-sflow-module:543c72a:sflow
+SFLOW_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_sflow_config.c \
+ ${PATCHDIR}/extra-patch-ngx_http_sflow_config.h \
+ ${PATCHDIR}/extra-patch-ngx_http_sflow_module.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_VARS= DSO_EXTMODS+=slowfs_cache
+
+SRCACHE_GH_TUPLE= openresty:srcache-nginx-module:be22ac0:srcache
+SRCACHE_VARS= DSO_EXTMODS+=srcache
+
+STS_IMPLIES= STREAM
+STS_GH_TUPLE= vozlt:nginx-module-sts:3c10d42:sts
+STS_VARS= DSO_EXTMODS+=sts
+
+VOD_GH_TUPLE= kaltura:nginx-vod-module:1.31:vod
+VOD_LIB_DEPENDS= libxml2.so:textproc/libxml2 \
+ libavutil.so:multimedia/ffmpeg
+VOD_USES= iconv
+VOD_VARS= DSO_EXTMODS+=vod
+
+VTS_GH_TUPLE= vozlt:nginx-module-vts:bf64dbf:vts
+VTS_VARS= DSO_EXTMODS+=vts
+
+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_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_VARS= DSO_EXTMODS+=zstd
diff --git a/www/freenginx-devel/Makefile.options.desc b/www/freenginx-devel/Makefile.options.desc
new file mode 100644
index 000000000000..f2b3924b69f8
--- /dev/null
+++ b/www/freenginx-devel/Makefile.options.desc
@@ -0,0 +1,118 @@
+AJP_DESC= 3rd party ajp module
+ARRAYVAR_DESC= 3rd party array_var module
+AWS_AUTH_DESC= 3rd party aws auth module
+BROTLI_DESC= 3rd party brotli module
+CACHE_PURGE_DESC= 3rd party cache_purge module
+CT_DESC= 3rd party cert_transparency module (SSL req.)
+DEBUGLOG_DESC= Enable debug log (--with-debug)
+DEVEL_KIT_DESC= 3rd party Nginx Development Kit module
+DRIZZLE_DESC= 3rd party drizzle module
+DSO_DESC= Enable dynamic modules support
+DYNAMIC_UPSTREAM_DESC= 3rd party dynamic_upstream module
+ECHO_DESC= 3rd party echo module
+ENCRYPTSESSION_DESC= 3rd party encrypted_session module
+FILE_AIO_DESC= Enable file aio
+FIPS_CHECK_DESC= 3rd party fips_check module
+FORMINPUT_DESC= 3rd party form_input module
+GOOGLE_PERFTOOLS_DESC= Enable google perftools module
+GRIDFS_DESC= 3rd party gridfs module
+GSSAPI_DESC= GSSAPI implementation (imply HTTP_AUTH_KRB5)
+HEADERS_MORE_DESC= 3rd party headers_more module
+HTTPGRP_DESC= Modules that require HTTP module
+HTTPV2_DESC= Enable HTTP/2 protocol support (SSL req.)
+HTTPV3_DESC= Enable HTTP/3 protocol support
+HTTPV3_BORING_DESC= Use security/boringssl
+HTTPV3_LSSL_DESC= Use security/libressl-devel
+HTTPV3_QTLS_DESC= Use security/openssl-quictls
+HTTP_ACCEPT_LANGUAGE_DESC= 3rd party accept_language module
+HTTP_ADDITION_DESC= Enable http_addition module
+HTTP_AUTH_DIGEST_DESC= 3rd party http_authdigest module
+HTTP_AUTH_KRB5_DESC= 3rd party http_auth_gss module
+HTTP_AUTH_LDAP_DESC= 3rd party http_auth_ldap module
+HTTP_AUTH_PAM_DESC= 3rd party http_auth_pam module
+HTTP_AUTH_REQ_DESC= Enable http_auth_request module
+HTTP_CACHE_DESC= Enable http_cache module
+HTTP_DAV_DESC= Enable http_webdav module
+HTTP_DAV_EXT_DESC= 3rd party webdav_ext module
+HTTP_DEGRADATION_DESC= Enable http_degradation module
+HTTP_DESC= Enable HTTP module
+HTTP_EVAL_DESC= 3rd party eval module
+HTTP_FANCYINDEX_DESC= 3rd party http_fancyindex module
+HTTP_FLV_DESC= Enable http_flv module
+HTTP_FOOTER_DESC= 3rd party http_footer module
+HTTP_GEOIP2_DESC= 3rd party geoip2 module
+HTTP_GUNZIP_FILTER_DESC= Enable http_gunzip_filter module
+HTTP_GZIP_STATIC_DESC= Enable http_gzip_static module
+HTTP_IMAGE_FILTER_DESC= Enable http_image_filter module
+HTTP_IP2LOCATION_DESC= 3rd party ip2location-nginx module
+HTTP_IP2PROXY_DESC= 3rd party ip2proxy-nginx module
+HTTP_JSON_STATUS_DESC= 3rd party http_json_status module
+HTTP_MOGILEFS_DESC= 3rd party mogilefs module
+HTTP_MP4_DESC= Enable http_mp4 module
+HTTP_NOTICE_DESC= 3rd party notice module
+HTTP_PERL_DESC= Enable http_perl module
+HTTP_PUSH_DESC= 3rd party push module
+HTTP_PUSH_STREAM_DESC= 3rd party push stream module
+HTTP_RANDOM_INDEX_DESC= Enable http_random_index module
+HTTP_REALIP_DESC= Enable http_realip module
+HTTP_REDIS_DESC= 3rd party http_redis module
+HTTP_SECURE_LINK_DESC= Enable http_secure_link module
+HTTP_SLICE_DESC= Enable http_slice module
+HTTP_SLICE_AHEAD_DESC= 3rd party http_slice_ahead module
+HTTP_SSL_DESC= Enable http_ssl module
+HTTP_STATUS_DESC= Enable http_stub_status module
+HTTP_SUBS_FILTER_DESC= 3rd party subs filter module
+HTTP_SUB_DESC= Enable http_sub module
+HTTP_TARANTOOL_DESC= 3rd party tarantool upstream module
+HTTP_UPLOAD_DESC= 3rd party upload module
+HTTP_UPLOAD_PROGRESS_DESC= 3rd party uploadprogress module
+HTTP_UPSTREAM_CHECK_DESC= 3rd party upstream check module
+HTTP_UPSTREAM_FAIR_DESC= 3rd party upstream fair module
+HTTP_UPSTREAM_STICKY_DESC= 3rd party upstream sticky module
+HTTP_VIDEO_DESC= 3rd party video module support
+HTTP_VIDEO_THUMBEXTRACTOR_DESC= 3rd party video_thumbextractor module
+HTTP_XSLT_DESC= Enable http_xslt module
+HTTP_ZIP_DESC= 3rd party http_zip module
+ICONV_DESC= 3rd party iconv module
+IPV6_DESC= Enable IPv6 support
+LET_DESC= 3rd party let module
+LINK_DESC= 3rd party link function module
+LUA_DESC= 3rd party lua module
+LUASTREAM_DESC= 3rd party lua stream module
+MAILGRP_DESC= Modules that require MAIL module
+MAIL_DESC= Enable IMAP4/POP3/SMTP proxy module
+MAIL_IMAP_DESC= Enable IMAP4 proxy module
+MAIL_POP3_DESC= Enable POP3 proxy module
+MAIL_SMTP_DESC= Enable SMTP proxy module
+MAIL_SSL_DESC= Enable mail_ssl module
+MEMC_DESC= 3rd party memc (memcached) module
+MODSECURITY3_DESC= 3rd party modsecurity3 module
+NAXSI_DESC= 3rd party naxsi module
+NJS_DESC= Enable javascript (NJS) module
+NJS_XML_DESC= Enable XML functionality in NJS module
+OTEL_DESC= Enable OpenTELemetry module
+PASSENGER_DESC= 3rd party passenger module
+POSTGRES_DESC= 3rd party postgres module
+RDS_CSV_DESC= 3rd party rds_csv module
+RDS_JSON_DESC= 3rd party rds_json module
+REDIS2_DESC= 3rd party redis2 module
+RTMP_DESC= 3rd party rtmp module
+SET_MISC_DESC= 3rd party set_misc module
+SFLOW_DESC= 3rd party sflow module
+SHIBBOLETH_DESC= 3rd party shibboleth module
+SLOWFS_CACHE_DESC= 3rd party slowfs_cache module
+SRCACHE_DESC= 3rd party srcache module
+STREAMGRP_DESC= Modules that require STREAM module
+STREAM_DESC= Enable stream module
+STREAM_REALIP_DESC= Enable stream_realip module
+STREAM_SSL_DESC= Enable stream_ssl module (SSL req.)
+STREAM_SSL_PREREAD_DESC= Enable stream_ssl_preread module (SSL req.)
+STS_DESC= 3rd party sts module
+THREADS_DESC= Enable threads support
+THIRDPARTYGRP_DESC= Third-party modules
+VOD_DESC= 3rd party vod module
+VTS_DESC= 3rd party vts module
+WWW_DESC= Enable html sample files
+XSS_DESC= 3rd party xss module
+WEBSOCKIFY_DESC= 3rd party websockify module
+ZSTD_DESC= 3rd party zstd module
diff --git a/www/freenginx-devel/distinfo b/www/freenginx-devel/distinfo
new file mode 100644
index 000000000000..88aca04f7723
--- /dev/null
+++ b/www/freenginx-devel/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1718897832
+SHA256 (freenginx-1.27.1.tar.gz) = 9570603b19f29566261bbbca67cc01343987de03a2ea7354fcbdef94f0eda439
+SIZE (freenginx-1.27.1.tar.gz) = 1223681
+SHA256 (stnoonan-spnego-http-auth-nginx-module-3575542_GH0.tar.gz) = 6d710f97bef58b2d5dc54445c0e48103786425f6d4ab18cf30a2168904d0ba62
+SIZE (stnoonan-spnego-http-auth-nginx-module-3575542_GH0.tar.gz) = 24680
diff --git a/www/freenginx-devel/files/extra-patch-calio-iconv-nginx-module-config b/www/freenginx-devel/files/extra-patch-calio-iconv-nginx-module-config
new file mode 100644
index 000000000000..fe9b12dc7747
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-calio-iconv-nginx-module-config
@@ -0,0 +1,19 @@
+--- ../iconv-nginx-module-0.14/config.orig 2013-04-16 17:57:17.000000000 -0700
++++ ../iconv-nginx-module-0.14/config 2013-05-01 17:16:28.134624745 -0700
+@@ -39,12 +39,12 @@
+ fi
+
+ if [ $ngx_found = no ]; then
+- ngx_feature="libiconv in /usr/local/"
+- ngx_feature_path="/usr/local/include"
++ ngx_feature="libiconv in %%PREFIX%%/"
++ ngx_feature_path="%%PREFIX%%/include"
+ if [ $NGX_RPATH = YES ]; then
+- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -liconv"
++ ngx_feature_libs="-R%%PREFIX%%/lib -L%%PREFIX%%/lib -liconv"
+ else
+- ngx_feature_libs="-L/usr/local/lib -liconv"
++ ngx_feature_libs="-L%%PREFIX%%/lib -liconv"
+ fi
+ . auto/feature
+ fi
diff --git a/www/freenginx-devel/files/extra-patch-naxsi-libinjection__sqli_c b/www/freenginx-devel/files/extra-patch-naxsi-libinjection__sqli_c
new file mode 100644
index 000000000000..bdd074b620dd
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-naxsi-libinjection__sqli_c
@@ -0,0 +1,13 @@
+--- ../libinjection-4aa3894/src/libinjection_sqli.c.orig 2023-05-30 15:47:57.333208000 -0400
++++ ../libinjection-4aa3894/src/libinjection_sqli.c 2023-05-30 15:49:52.273873000 -0400
+@@ -305,8 +303,8 @@
+ static void st_assign(stoken_t * st, const char stype,
+ size_t pos, size_t len, const char* value)
+ {
+- const size_t MSIZE = LIBINJECTION_SQLI_TOKEN_SIZE;
+- size_t last = len < MSIZE ? len : (MSIZE - 1);
++ const size_t NAXSI_MSIZE = LIBINJECTION_SQLI_TOKEN_SIZE;
++ size_t last = len < NAXSI_MSIZE ? len : (NAXSI_MSIZE - 1);
+ st->type = (char) stype;
+ st->pos = pos;
+ st->len = last;
diff --git a/www/freenginx-devel/files/extra-patch-naxsi_config b/www/freenginx-devel/files/extra-patch-naxsi_config
new file mode 100644
index 000000000000..8fa8a4785527
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-naxsi_config
@@ -0,0 +1,26 @@
+--- ../naxsi-1.6/naxsi_src/config.orig 2023-09-27 09:43:18.644606000 -0400
++++ ../naxsi-1.6/naxsi_src/config 2023-09-27 09:44:37.585970000 -0400
+@@ -24,11 +24,6 @@
+ "
+
+ # try to use libinjection as system library
+-LIBINJECTION_CFLAGS="$(pkg-config --cflags libinjection)"
+-LIBINJECTION_LIBS="$(pkg-config --libs libinjection)"
+-LIBINJECTION_FOUND="$?"
+-
+-if [ "$LIBINJECTION_FOUND" != "0" ]; then
+ if [ ! -d "$ngx_addon_dir/libinjection/src/" ]; then
+ echo "Cannot find 'libinjection' submodule."
+ exit 1;
+@@ -43,11 +38,6 @@
+ naxsi_sources="$naxsi_sources $ngx_addon_dir/libinjection_ngxbuild/$src_file"
+ done;
+ CFLAGS="$CFLAGS -DLIBINJECTION_VERSION=0 -I$ngx_addon_dir/libinjection_ngxbuild/"
+-else
+- echo "Using system libinjection"
+- CFLAGS="$CFLAGS $LIBINJECTION_CFLAGS"
+- ngx_feature_libs="$LIBINJECTION_LIBS"
+-fi
+
+ # NGINX module condfiguration.
+ ngx_addon_name=naxsi
diff --git a/www/freenginx-devel/files/extra-patch-nginx-ct-LibreSSL b/www/freenginx-devel/files/extra-patch-nginx-ct-LibreSSL
new file mode 100644
index 000000000000..9aa89a463a9d
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-nginx-ct-LibreSSL
@@ -0,0 +1,20 @@
+--- ../nginx-ct-93e9884/ngx_ssl_ct_module.c.orig 2017-07-23 08:03:35.000000000 -0400
++++ ../nginx-ct-93e9884/ngx_ssl_ct_module.c 2018-04-24 16:58:27.698435000 -0400
+@@ -158,7 +158,7 @@
+ #endif
+ }
+
+-#ifndef OPENSSL_IS_BORINGSSL
++#if !defined(OPENSSL_IS_BORINGSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ /* add OpenSSL TLS extension */
+ # if OPENSSL_VERSION_NUMBER >= 0x10101000L
+ int context = SSL_EXT_CLIENT_HELLO
+@@ -183,7 +183,7 @@
+ return NGX_CONF_OK;
+ }
+
+-#ifndef OPENSSL_IS_BORINGSSL
++#if !defined(OPENSSL_IS_BORINGSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ # if OPENSSL_VERSION_NUMBER >= 0x10101000L
+ int ngx_ssl_ct_ext_cb(SSL *s, unsigned int ext_type, unsigned int context,
+ const unsigned char **out, size_t *outlen, X509 *x, size_t chainidx,
diff --git a/www/freenginx-devel/files/extra-patch-nginx-http-footer-filter-config b/www/freenginx-devel/files/extra-patch-nginx-http-footer-filter-config
new file mode 100644
index 000000000000..880856c7292d
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-nginx-http-footer-filter-config
@@ -0,0 +1,12 @@
+--- ../nginx-http-footer-filter-1.2.2/config.orig 2020-04-24 08:37:44.671689000 -0400
++++ ../nginx-http-footer-filter-1.2.2/config 2020-04-24 08:44:41.868601000 -0400
+@@ -1,3 +1,7 @@
+ ngx_addon_name=ngx_http_footer_filter_module
+-HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES ngx_http_footer_filter_module"
+-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_footer_filter_module.c"
++ngx_module_type=HTTP_FILTER
++ngx_module_name="$ngx_addon_name"
++
++ngx_module_srcs="$ngx_addon_dir/ngx_http_footer_filter_module.c"
++
++. auto/module
diff --git a/www/freenginx-devel/files/extra-patch-nginx-link-function-config b/www/freenginx-devel/files/extra-patch-nginx-link-function-config
new file mode 100644
index 000000000000..725490ef14c3
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-nginx-link-function-config
@@ -0,0 +1,42 @@
+--- ../nginx-link-function-3.2.4/config.orig 2020-10-12 22:32:47.000000000 -0400
++++ ../nginx-link-function-3.2.4/config 2020-11-13 12:26:56.186032000 -0500
+@@ -15,24 +15,6 @@
+ #echo "#define NGINX_HTTP_HTTP_LINK_FUNC_VERSION \""$HTTP_LINK_FUNC_VERSION"\"" > $NGX_OBJS/ngx_vod_version.h
+
+
+-# ngx_link_func_module headers
+-# to Test this in order to share the header file to other client instead of just depend on it owns
+-ngx_feature="ngx_http_link_func"
+-ngx_feature_name="NGX_HAVE_HTTP_LINK_FUNC_HEADERS"
+-ngx_feature_run=no
+-ngx_feature_incs="#include <ngx_link_func_module.h>"
+-ngx_feature_path=
+-ngx_feature_libs=
+-# ngx_feature_exit_if_not_found=yes
+-ngx_feature_test="int ngx_link_func_module_current_version_=ngx_link_func_module_version_34;"
+-. auto/feature
+-
+-if [ $ngx_found != yes ]; then
+-echo "ngx_link_func_module.h not found or version not aligned in your system c header path, please copy latest ngx_link_func_module.h to your /usr/include or /usr/local/include or relavent header search path with read and write permission given."
+-echo "e.g install -m 644 ../nginx-link-function/src/ngx_link_func_module.h /usr/local/include/"
+-echo
+-exit 1
+-else
+ cat $ngx_addon_dir/build_test_resources/sanity_test_raw_parse.t > $ngx_addon_dir/t/sanity.t
+ if [ $USE_THREADS = YES ]; then
+ cat $ngx_addon_dir/build_test_resources/sanity_test_aio_parse.t >> $ngx_addon_dir/t/sanity.t
+@@ -42,13 +24,12 @@
+ if [ $USE_THREADS = YES ]; then
+ cat $ngx_addon_dir/build_test_resources/sanity_test_subrequest_aio_parse.t >> $ngx_addon_dir/t/sanity.t
+ fi
+-fi
+ ABSOLUTE_NGX_LINKFUNC_CURRENT_PATH="$( cd "$ngx_addon_dir" ; pwd -P )"
+ if [ "$NGX_SYSTEM" = "Darwin" ]; then
+ clang -dynamiclib -o $ngx_addon_dir/t/liblinkfuntest.dylib -fPIC $ngx_addon_dir/build_test_resources/linkfuntest.c -Wl,-undefined,dynamic_lookup
+ sed -i '' "s@NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH@$ABSOLUTE_NGX_LINKFUNC_CURRENT_PATH/t/liblinkfuntest.dylib@g" $ngx_addon_dir/t/sanity.t
+ else
+-if [ "$NGX_PLATFORM" != win32 ]; then
++if [ "$NGX_PLATFORM" = win32 ]; then
+ cc -shared -o $ngx_addon_dir/t/liblinkfuntest.so -fPIC $ngx_addon_dir/build_test_resources/linkfuntest.c
+ sed -i "s@NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH@$ABSOLUTE_NGX_LINKFUNC_CURRENT_PATH/t/liblinkfuntest.so@g" $ngx_addon_dir/t/sanity.t
+ fi
diff --git a/www/freenginx-devel/files/extra-patch-nginx-notice-config b/www/freenginx-devel/files/extra-patch-nginx-notice-config
new file mode 100644
index 000000000000..cd333a115624
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-nginx-notice-config
@@ -0,0 +1,13 @@
+--- ../nginx-notice-3c95966/config.orig 2020-04-25 18:03:28.543102000 -0400
++++ ../nginx-notice-3c95966/config 2020-04-25 18:04:14.387235000 -0400
+@@ -1,3 +1,8 @@
+ ngx_addon_name=ngx_http_notice_module
+-HTTP_MODULES="$HTTP_MODULES ngx_http_notice_module"
+-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_notice_module.c"
++
++ngx_module_name="$ngx_addon_name"
++ngx_module_type=HTTP
++
++ngx_module_srcs="$ngx_addon_dir/ngx_http_notice_module.c"
++
++. auto/module
diff --git a/www/freenginx-devel/files/extra-patch-nginx-thumbextractor-module-config b/www/freenginx-devel/files/extra-patch-nginx-thumbextractor-module-config
new file mode 100644
index 000000000000..6324fd9fcc52
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-nginx-thumbextractor-module-config
@@ -0,0 +1,25 @@
+--- ../nginx-video-thumbextractor-module-e81f850/config.orig 2024-02-22 08:49:55.972829000 -0500
++++ ../nginx-video-thumbextractor-module-e81f850/config 2024-02-22 08:50:05.036983000 -0500
+@@ -1,9 +1,14 @@
+ ngx_addon_name=ngx_http_video_thumbextractor_module
+-ngx_feature_libs="-lavformat -lavcodec -lavutil -lavfilter -lswscale -lswresample -lpostproc -ljpeg"
+-HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name"
+-CORE_INCS="$CORE_INCS \
+- $ngx_addon_dir/src \
+- $ngx_addon_dir/include"
+-NGX_ADDON_SRCS="$NGX_ADDON_SRCS \
+- ${ngx_addon_dir}/src/ngx_http_video_thumbextractor_module.c"
+-CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
++ngx_module_libs="-lavformat -lavcodec -lavutil -lavfilter -lswscale -lswresample -lpostproc -ljpeg"
++ngx_module_incs="$ngx_addon_dir/include $ngx_addon_dir/src"
++
++if test -n "$ngx_module_link"; then
++ ngx_module_type=HTTP
++ ngx_module_name=$ngx_addon_name
++ ngx_module_srcs="${ngx_addon_dir}/src/ngx_http_video_thumbextractor_module.c"
++ . auto/module
++else
++ HTTP_MODULES="$HTTP_MODULES $ngx_addon_name"
++ NGX_ADDON_SRCS="$NGX_ADDON_SRCS \
++ ${ngx_addon_dir}/src/ngx_http_video_thumbextractor_module.c"
++fi
diff --git a/www/freenginx-devel/files/extra-patch-nginx_mogilefs_module-config b/www/freenginx-devel/files/extra-patch-nginx_mogilefs_module-config
new file mode 100644
index 000000000000..48a67fffb608
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-nginx_mogilefs_module-config
@@ -0,0 +1,13 @@
+--- ../nginx_mogilefs_module-1.0.4/config.orig 2020-04-25 17:51:45.544308000 -0400
++++ ../nginx_mogilefs_module-1.0.4/config 2020-04-25 17:54:01.862958000 -0400
+@@ -1,3 +1,8 @@
+ ngx_addon_name=ngx_http_mogilefs_module
+-HTTP_MODULES="$HTTP_MODULES ngx_http_mogilefs_module"
+-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_mogilefs_module.c"
++
++ngx_module_name="$ngx_addon_name"
++ngx_module_type=HTTP
++
++ngx_module_srcs="$ngx_addon_dir/ngx_http_mogilefs_module.c"
++
++. auto/module
diff --git a/www/freenginx-devel/files/extra-patch-ngx_brotli_filter_config b/www/freenginx-devel/files/extra-patch-ngx_brotli_filter_config
new file mode 100644
index 000000000000..dfac8cfe5696
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_brotli_filter_config
@@ -0,0 +1,41 @@
+--- ../ngx_brotli-a71f931/filter/config.orig 2023-09-30 13:17:01.637746000 -0400
++++ ../ngx_brotli-a71f931/filter/config 2023-09-30 13:23:51.839920000 -0400
+@@ -42,33 +42,16 @@
+ ngx_module_type=HTTP_FILTER
+ ngx_module_name=ngx_http_brotli_filter_module
+
+-brotli="$ngx_addon_dir/deps/brotli/c"
+-if [ ! -f "$brotli/include/brotli/encode.h" ]; then
+-cat << END
++BROTLI_ENC_H="%%PREFIX%%/include/brotli/encode.h \
++ %%PREFIX%%/include/brotli/port.h \
++ %%PREFIX%%/include/brotli/types.h"
+
+-$0: error: \
+-Brotli library is missing from the $brotli directory.
+
+-Please make sure that the git submodule has been checked out:
+-
+- cd $ngx_addon_dir && git submodule update --init && cd $PWD
+-
+-END
+- exit 1
+-fi
+-
+-BROTLI_OUTPUT_DIRECTORY="$brotli/../out"
+-BROTLI_ENC_H="$brotli/include/brotli/encode.h \
+- $brotli/include/brotli/port.h \
+- $brotli/include/brotli/types.h"
+-
+-
+-ngx_module_incs="$brotli/include"
++ngx_module_incs="$BROTLI_ENC_H"
+ ngx_module_deps="$BROTLI_ENC_H"
+ ngx_module_srcs="$BROTLI_MODULE_SRC_DIR/ngx_http_brotli_filter_module.c"
+-ngx_module_libs="-L$BROTLI_OUTPUT_DIRECTORY -lbrotlienc -lbrotlicommon -lm"
++ngx_module_libs="-L%%PREFIX%%/lib -lbrotlienc -lbrotlicommon -lm"
+ ngx_module_order="$ngx_module_name \
+- ngx_pagespeed \
+ ngx_http_postpone_filter_module \
+ ngx_http_ssi_filter_module \
+ ngx_http_charset_filter_module \
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_auth_ldap_module.c b/www/freenginx-devel/files/extra-patch-ngx_http_auth_ldap_module.c
new file mode 100644
index 000000000000..d8bc2f7f65f3
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_auth_ldap_module.c
@@ -0,0 +1,10 @@
+--- ../nginx-auth-ldap-83c059b/ngx_http_auth_ldap_module.c.orig 2022-08-21 17:04:57.754760000 +0300
++++ ../nginx-auth-ldap-83c059b/ngx_http_auth_ldap_module.c 2022-08-21 17:08:46.939318000 +0300
+@@ -1779,6 +1779,7 @@
+ }
+
+ r->headers_out.www_authenticate->hash = 1;
++ r->headers_out.www_authenticate->next = NULL;
+ r->headers_out.www_authenticate->key.len = sizeof("WWW-Authenticate") - 1;
+ r->headers_out.www_authenticate->key.data = (u_char *) "WWW-Authenticate";
+ r->headers_out.www_authenticate->value = *realm;
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_dav_ext_module.c b/www/freenginx-devel/files/extra-patch-ngx_http_dav_ext_module.c
new file mode 100644
index 000000000000..cf66be99de49
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_dav_ext_module.c
@@ -0,0 +1,15 @@
+--- ../nginx-dav-ext-module-3.0.0/ngx_http_dav_ext_module.c 2018-12-17 11:45:12.000000000 +0300
++++ ../nginx-dav-ext-module-3.0.0/ngx_http_dav_ext_module.c 2020-03-13 01:20:47.498199000 +0300
+@@ -896,10 +896,9 @@
+ ngx_cpystrn(last, name.data, name.len + 1);
+
+ if (ngx_de_info(filename, &dir) == NGX_FILE_ERROR) {
+- ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
++ ngx_log_error(NGX_LOG_ERR, r->connection->log, ngx_errno,
+ ngx_de_info_n " \"%s\" failed", filename);
+- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
+- break;
++ continue;
+ }
+ }
+
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_json_status_module-config b/www/freenginx-devel/files/extra-patch-ngx_http_json_status_module-config
new file mode 100644
index 000000000000..84c4a62ef6cf
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_json_status_module-config
@@ -0,0 +1,12 @@
+--- ../ngx_http_json_status_module-1d2f303/config.orig 2020-04-25 16:16:47.024292000 -0400
++++ ../ngx_http_json_status_module-1d2f303/config 2020-04-25 16:18:39.461340000 -0400
+@@ -1,4 +1,6 @@
+ ngx_addon_name=ngx_http_json_status_module
+-HTTP_MODULES="$HTTP_MODULES ngx_http_json_status_module"
+-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_json_status_module.c"
+-NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/ngx_http_json_status_module.h"
++ngx_module_name="$ngx_addon_name"
++ngx_module_type=HTTP
++ngx_module_srcs="$ngx_addon_dir/ngx_http_json_status_module.c"
++ngx_module_deps="$ngx_addon_dir/ngx_http_json_status_module.h"
++. auto/module
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_mogilefs_module.c b/www/freenginx-devel/files/extra-patch-ngx_http_mogilefs_module.c
new file mode 100644
index 000000000000..423483869d57
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_mogilefs_module.c
@@ -0,0 +1,12 @@
+--- ../nginx_mogilefs_module-1.0.4/ngx_http_mogilefs_module.c.orig 2015-04-21 21:16:22.251692000 +0300
++++ ../nginx_mogilefs_module-1.0.4/ngx_http_mogilefs_module.c 2015-04-21 21:16:39.460724000 +0300
+@@ -316,9 +316,6 @@
+
+ u->peer.log = r->connection->log;
+ u->peer.log_error = NGX_ERROR_ERR;
+-#if (NGX_THREADS)
+- u->peer.lock = &r->connection->lock;
+-#endif
+
+ u->output.tag = (ngx_buf_tag_t) &ngx_http_mogilefs_module;
+
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_notice_module.c b/www/freenginx-devel/files/extra-patch-ngx_http_notice_module.c
new file mode 100644
index 000000000000..d62135ed6f9c
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_notice_module.c
@@ -0,0 +1,11 @@
+--- ../nginx-notice-3c95966/ngx_http_notice_module.c.orig 2009-07-16 18:37:57.000000000 +0200
++++ ../nginx-notice-3c95966/ngx_http_notice_module.c 2009-07-16 08:09:38.000000000 +0200
+@@ -153,7 +153,7 @@
+ return NGX_HTTP_NOT_ALLOWED;
+ }
+
+- rc = ngx_http_discard_body(r);
++ rc = ngx_http_discard_request_body(r);
+
+ if (rc != NGX_OK && rc != NGX_AGAIN) {
+ return rc;
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_redis_module.c b/www/freenginx-devel/files/extra-patch-ngx_http_redis_module.c
new file mode 100644
index 000000000000..3dacd39ee6c4
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_redis_module.c
@@ -0,0 +1,34 @@
+--- ../ngx_http_redis-0.3.9/ngx_http_redis_module.c.orig 2022-07-10 22:10:19.031893000 -0400
++++ ../ngx_http_redis-0.3.9/ngx_http_redis_module.c 2022-07-10 22:09:41.271731000 -0400
+@@ -562,7 +562,7 @@
+ /* if defined gzip_flag... */
+ if (rlcf->gzip_flag) {
+ /* hash init */
+- h = ngx_list_push(&r->upstream->headers_in.headers);
++ h = ngx_list_push(&r->headers_out.headers);
+ if (h == NULL) {
+ return NGX_ERROR;
+ }
+@@ -571,19 +571,11 @@
+ * add Content-Encoding header for future gunzipping
+ * with ngx_http_gunzip_filter module
+ */
+- h->hash = ngx_hash(ngx_hash(ngx_hash(ngx_hash(
+- ngx_hash(ngx_hash(ngx_hash(
+- ngx_hash(ngx_hash(ngx_hash(
+- ngx_hash(ngx_hash(ngx_hash(
+- ngx_hash(ngx_hash('c', 'o'), 'n'), 't'), 'e'),
+- 'n'), 't'), '-'), 'e'), 'n'), 'c'), 'o'),
+- 'd'), 'i'), 'n'), 'g');
++ h->hash = 1;
++ h->next = NULL;
+ ngx_str_set(&h->key, "Content-Encoding");
+ ngx_str_set(&h->value, "gzip");
+- h->lowcase_key = (u_char*) "content-encoding";
+-#if (NGX_HTTP_GZIP)
+- u->headers_in.content_encoding = h;
+-#endif
++ r->headers_out.content_encoding = h;
+ }
+
+ /* try to find end of string */
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_sflow_config.c b/www/freenginx-devel/files/extra-patch-ngx_http_sflow_config.c
new file mode 100644
index 000000000000..3e3eaa2260f5
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_sflow_config.c
@@ -0,0 +1,10 @@
+--- ../nginx-sflow-module-543c72a/ngx_http_sflow_config.c.orig 2012-06-07 04:52:57.000000000 +0400
++++ ../nginx-sflow-module-543c72a/ngx_http_sflow_config.c 2012-06-07 04:59:18.000000000 +0400
+@@ -26,7 +26,6 @@
+ ngx_log_error(NGX_LOG_ERR, log, 0, "getaddrinfo() failed: %s", gai_strerror(err));
+ switch(err) {
+ case EAI_NONAME: break;
+- case EAI_NODATA: break;
+ case EAI_AGAIN: break; // loop and try again?
+ default: ngx_log_error(NGX_LOG_ERR, log, 0, "getaddrinfo() error: %s", gai_strerror(err)); break;
+ }
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_sflow_config.h b/www/freenginx-devel/files/extra-patch-ngx_http_sflow_config.h
new file mode 100644
index 000000000000..6b90d4eaaf14
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_sflow_config.h
@@ -0,0 +1,11 @@
+--- ../nginx-sflow-module-543c72a/ngx_http_sflow_config.h.orig 2012-07-31 21:36:49.000000000 +0400
++++ ../nginx-sflow-module-543c72a/ngx_http_sflow_config.h 2012-07-31 21:37:20.000000000 +0400
+@@ -17,7 +17,7 @@
+ -----------------___________________________------------------
+ */
+
+-#define SFWB_DEFAULT_CONFIGFILE "/etc/hsflowd.auto"
++#define SFWB_DEFAULT_CONFIGFILE "%%PREFIX%%/etc/hsflowd.auto"
+ #define SFWB_SEPARATORS " \t\r\n="
+ #define SFWB_QUOTES "'\" \t\r\n"
+ /* SFWB_MAX LINE LEN must be enough to hold the whole list of targets */
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_sflow_module.c b/www/freenginx-devel/files/extra-patch-ngx_http_sflow_module.c
new file mode 100644
index 000000000000..e6b4bad6e25f
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_sflow_module.c
@@ -0,0 +1,59 @@
+--- ../nginx-sflow-module-543c72a/ngx_http_sflow_module.c.orig 2014-09-24 18:20:41.000000000 -0400
++++ ../nginx-sflow-module-543c72a/ngx_http_sflow_module.c 2016-08-06 21:26:24.515559000 -0400
+@@ -8,9 +8,6 @@
+ #include <ngx_http.h>
+ #include <nginx.h>
+
+-#if (NGX_THREADS)
+-#include <ngx_thread.h>
+-#endif
+
+ #include "ngx_http_sflow_api.h"
+ #include "ngx_http_sflow_config.h"
+@@ -74,18 +71,10 @@
+ /* keep log ptr for callbacks */
+ ngx_log_t *log;
+
+-#if (NGX_THREADS)
+- ngx_mutex_t *mut;
+-#define SFWB_LOCK(_s) ngx_mutex_lock((_s)->mut)
+-#define SFWB_UNLOCK(_s) ngx_mutex_unlock((_s)->mut)
+-#define SFWB_INC_CTR(_c) ngx_atomic_fetch_add(&(_c), 1)
+-#define SFWB_COUNTDOWN(_c) (ngx_atomic_fetch_add(&(_c), -1) == 1)
+-#else
+ #define SFWB_LOCK(_s) /* no-op */
+ #define SFWB_UNLOCK(_s) /* no-op */
+ #define SFWB_INC_CTR(_c) (_c)++
+ #define SFWB_COUNTDOWN(_c) (--(_c) == 0)
+-#endif
+
+ /* skip countdown is handled per-worker to reduce lock contention.
+ * If all processes sample at 1:N it's the same as having only one
+@@ -645,13 +634,8 @@
+ {
+ sm->random_seed = ((sm->random_seed * 32719) + 3) % 32749;
+ ngx_atomic_t next_skip = (sm->random_seed % ((2 * sm->sampling_rate) - 1)) + 1;
+-#if (NGX_THREADS)
+- ngx_atomic_int_t test_skip = ngx_atomic_fetch_add(&sm->sflow_skip, next_skip);
+- return (test_skip + next_skip);
+-#else
+ sm->sflow_skip = next_skip;
+ return next_skip;
+-#endif
+ }
+
+ /*_________________---------------------------__________________
+@@ -864,13 +848,6 @@
+ {
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cf->log, 0, "sflow: sfwb_init()");
+
+-#if (NGX_THREADS)
+- /* a mutex to lock the sFlow agent when taking a sample (only needed if there
+- * is more that one worker thread - right now it seems like threads are not even
+- * an option in the configure script)
+- */
+- sm->mut = ngx_mutex_init(cf->log, 0);
+-#endif
+
+ /* look up some vars by name and cache the index numbers -- see ngx_http_variables.c */
+ ngx_str_t str_uri = ngx_string("request_uri"); /* the "unparsed" variant */
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_tarantool-config b/www/freenginx-devel/files/extra-patch-ngx_http_tarantool-config
new file mode 100644
index 000000000000..196a8135ca2d
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_tarantool-config
@@ -0,0 +1,24 @@
+--- ../nginx_upstream_module-aeb8696/config.orig 2017-09-18 11:54:00.000000000 -0400
++++ ../nginx_upstream_module-aeb8696/config 2017-12-04 21:56:41.978227000 -0500
+@@ -7,18 +7,10 @@
+ $ngx_addon_dir/third_party \
+ "
+
+-test -f $ngx_addon_dir/third_party/yajl/build/yajl-2.1.0/lib/libyajl_s.a &&
+-test -f $ngx_addon_dir/third_party/msgpuck/libmsgpuck.a && {
+- libs=" \
+- $ngx_addon_dir/third_party/yajl/build/yajl-2.1.0/lib/libyajl_s.a \
+- $ngx_addon_dir/third_party/msgpuck/libmsgpuck.a \
+- "
+-
+- include_paths="${include_paths} \
+- $ngx_addon_dir/third_party/msgpuck \
+- $ngx_addon_dir/third_party/yajl/build/yajl-2.1.0/include \
++include_paths="${include_paths} \
++ %%PREFIX%%/include/msgpuck \
++ %%PREFIX%%/include/yajl \
+ "
+-}
+
+ module_src_dir="$ngx_addon_dir/src"
+
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_uploadprogress_module.c b/www/freenginx-devel/files/extra-patch-ngx_http_uploadprogress_module.c
new file mode 100644
index 000000000000..5dfbdbfea794
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_uploadprogress_module.c
@@ -0,0 +1,73 @@
+--- ../nginx-upload-progress-module-68b3ab3/ngx_http_uploadprogress_module.c.orig 2021-12-24 10:53:38.000000000 -0500
++++ ../nginx-upload-progress-module-68b3ab3/ngx_http_uploadprogress_module.c 2022-07-10 22:24:32.435330000 -0400
+@@ -559,12 +559,12 @@
+ ngx_chain_t out;
+ ngx_int_t rc, found=0, done=0, err_status=0;
+ off_t rest=0, length=0;
+- ngx_uint_t len, i;
++ ngx_uint_t len;
+ ngx_slab_pool_t *shpool;
+ ngx_http_uploadprogress_conf_t *upcf;
+ ngx_http_uploadprogress_ctx_t *ctx;
+ ngx_http_uploadprogress_node_t *up;
+- ngx_table_elt_t *expires, *cc, **ccp;
++ ngx_table_elt_t *expires, *cc;
+ ngx_http_uploadprogress_state_t state;
+ ngx_http_uploadprogress_template_t *t;
+
+@@ -637,6 +637,7 @@
+ }
+
+ r->headers_out.expires = expires;
++ expires->next = NULL;
+
+ expires->hash = 1;
+ expires->key.len = sizeof("Expires") - 1;
+@@ -646,37 +647,30 @@
+ len = sizeof("Mon, 28 Sep 1970 06:00:00 GMT");
+ expires->value.len = len - 1;
+
+- ccp = r->headers_out.cache_control.elts;
+- if (ccp == NULL) {
++ cc = r->headers_out.cache_control;
+
+- if (ngx_array_init(&r->headers_out.cache_control, r->pool,
+- 1, sizeof(ngx_table_elt_t *))
+- != NGX_OK) {
+- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+- }
++ if (cc == NULL) {
+
+- ccp = ngx_array_push(&r->headers_out.cache_control);
+- if (ccp == NULL) {
+- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+- }
+-
+ cc = ngx_list_push(&r->headers_out.headers);
+ if (cc == NULL) {
++ expires->hash = 0;
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
+
++ r->headers_out.cache_control = cc;
++ cc->next = NULL;
++
+ cc->hash = 1;
+ cc->key.len = sizeof("Cache-Control") - 1;
+ cc->key.data = (u_char *) "Cache-Control";
+
+- *ccp = cc;
+-
+ } else {
+- for (i = 1; i < r->headers_out.cache_control.nelts; i++) {
+- ccp[i]->hash = 0;
++ for (cc = cc->next; cc; cc = cc->next) {
++ cc->hash = 0;
+ }
+
+- cc = ccp[0];
++ cc = r->headers_out.cache_control;
++ cc->next = NULL;
+ }
+
+ expires->value.data = (u_char *) "Thu, 01 Jan 1970 00:00:01 GMT";
diff --git a/www/freenginx-devel/files/extra-patch-ngx_link_func_module.c b/www/freenginx-devel/files/extra-patch-ngx_link_func_module.c
new file mode 100644
index 000000000000..31348a346dae
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_link_func_module.c
@@ -0,0 +1,11 @@
+--- ../nginx-link-function-3.2.4/src/ngx_link_func_module.c.orig 2020-01-24 10:32:50.550797000 -0500
++++ ../nginx-link-function-3.2.4/src/ngx_link_func_module.c 2020-01-24 10:33:17.135348000 -0500
+@@ -35,7 +35,7 @@
+ #include <ngx_config.h>
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+-#include <ngx_link_func_module.h>
++#include "ngx_link_func_module.h"
+
+ #define MODULE_NAME "nginx_link_function"
+
diff --git a/www/freenginx-devel/files/extra-patch-ngx_postgres-config b/www/freenginx-devel/files/extra-patch-ngx_postgres-config
new file mode 100644
index 000000000000..8c26c0f7dd64
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_postgres-config
@@ -0,0 +1,19 @@
+--- ../ngx_postgres-8aa7359/config.orig 2015-05-26 20:52:25.649166000 +0300
++++ ../ngx_postgres-8aa7359/config 2015-05-26 20:53:10.331122000 +0300
+@@ -48,12 +48,12 @@
+
+ if [ $ngx_found = no ]; then
+ # FreeBSD
+- ngx_feature="libpq library in /usr/local/"
+- ngx_feature_path="/usr/local/include"
++ ngx_feature="libpq library in %%PREFIX%%/"
++ ngx_feature_path="%%PREFIX%%/include"
+ if [ $NGX_RPATH = YES ]; then
+- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lpq"
++ ngx_feature_libs="-R%%PREFIX%%/lib -L%%PREFIX%%/lib -lpq"
+ else
+- ngx_feature_libs="-L/usr/local/lib -lpq"
++ ngx_feature_libs="-L%%PREFIX%%/lib -lpq"
+ fi
+ . auto/feature
+ fi
diff --git a/www/freenginx-devel/files/extra-patch-ngx_stream_ssl_ct_module.c b/www/freenginx-devel/files/extra-patch-ngx_stream_ssl_ct_module.c
new file mode 100644
index 000000000000..b3df57b24218
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_stream_ssl_ct_module.c
@@ -0,0 +1,14 @@
+--- ../nginx-ct-93e9884/ngx_stream_ssl_ct_module.c.orig 2024-04-18 12:32:44.086600000 -0400
++++ ../nginx-ct-93e9884/ngx_stream_ssl_ct_module.c 2024-04-18 12:37:40.764525000 -0400
+@@ -70,7 +70,11 @@
+
+ static char *ngx_stream_ssl_ct_merge_srv_conf(ngx_conf_t *cf, void *parent,
+ void *child) {
++#if nginx_version >= 1025005
++ ngx_stream_ssl_srv_conf_t *ssl_conf = ngx_stream_conf_get_module_srv_conf(cf,
++#else
+ ngx_stream_ssl_conf_t *ssl_conf = ngx_stream_conf_get_module_srv_conf(cf,
++#endif
+ ngx_stream_ssl_module);
+
+ ngx_array_t *certificates;
diff --git a/www/freenginx-devel/files/extra-patch-openresty-drizzle-nginx-module-config b/www/freenginx-devel/files/extra-patch-openresty-drizzle-nginx-module-config
new file mode 100644
index 000000000000..294d22a346cf
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-openresty-drizzle-nginx-module-config
@@ -0,0 +1,42 @@
+--- ../drizzle-nginx-module-3504fc6/config.orig 2020-01-22 18:04:58.000000000 -0500
++++ ../drizzle-nginx-module-3504fc6/config 2020-04-24 06:23:01.264872000 -0400
+@@ -34,12 +34,12 @@
+
+ if [ $ngx_found = no ]; then
+ # FreeBSD, OpenBSD
+- ngx_feature="libdrizzle library in /usr/local/"
+- ngx_feature_path="/usr/local/include/libdrizzle-1.0"
++ ngx_feature="libdrizzle library in %%PREFIX%%"
++ ngx_feature_path="%%PREFIX%%/include/libdrizzle"
+ if [ $NGX_RPATH = YES ]; then
+- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -ldrizzle"
++ ngx_feature_libs="-R%%PREFIX%%/lib -L%%PREFIX%%/lib -ldrizzle"
+ else
+- ngx_feature_libs="-L/usr/local/lib -ldrizzle"
++ ngx_feature_libs="-L%%PREFIX%%/lib -ldrizzle"
+ fi
+ . auto/feature
+ fi
+@@ -80,8 +80,19 @@
+ fi
+
+ ngx_addon_name=ngx_http_drizzle_module
+-HTTP_MODULES="$HTTP_MODULES ngx_http_drizzle_module"
+-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_drizzle_module.c $ngx_addon_dir/src/ngx_http_drizzle_handler.c $ngx_addon_dir/src/ngx_http_drizzle_processor.c $ngx_addon_dir/src/ngx_http_drizzle_upstream.c $ngx_addon_dir/src/ngx_http_drizzle_util.c $ngx_addon_dir/src/ngx_http_drizzle_output.c $ngx_addon_dir/src/ngx_http_drizzle_keepalive.c $ngx_addon_dir/src/ngx_http_drizzle_quoting.c $ngx_addon_dir/src/ngx_http_drizzle_checker.c"
+-NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/ngx_http_drizzle_module.h $ngx_addon_dir/src/ngx_http_drizzle_handler.h $ngx_addon_dir/src/ngx_http_drizzle_processor.h $ngx_addon_dir/src/ngx_http_drizzle_upstream.h $ngx_addon_dir/src/ngx_http_drizzle_util.h $ngx_addon_dir/src/ngx_http_drizzle_output.h $ngx_addon_dir/src/resty_dbd_stream.h $ngx_addon_dir/src/ngx_http_drizzle_keepalive.h $ngx_addon_dir/src/ngx_http_drizzle_quoting.h $ngx_addon_dir/src/ngx_http_drizzle_checker.h"
++if test -n "$ngx_module_link"; then
++ ngx_module_type=HTTP
++ ngx_module_name=$ngx_addon_name
++ ngx_module_srcs="$ngx_addon_dir/src/ngx_http_drizzle_module.c $ngx_addon_dir/src/ngx_http_drizzle_handler.c $ngx_addon_dir/src/ngx_http_drizzle_processor.c $ngx_addon_dir/src/ngx_http_drizzle_upstream.c $ngx_addon_dir/src/ngx_http_drizzle_util.c $ngx_addon_dir/src/ngx_http_drizzle_output.c $ngx_addon_dir/src/ngx_http_drizzle_keepalive.c $ngx_addon_dir/src/ngx_http_drizzle_quoting.c $ngx_addon_dir/src/ngx_http_drizzle_checker.c"
++ ngx_module_incs="$ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/ngx_http_drizzle_module.h $ngx_addon_dir/src/ngx_http_drizzle_handler.h $ngx_addon_dir/src/ngx_http_drizzle_processor.h $ngx_addon_dir/src/ngx_http_drizzle_upstream.h $ngx_addon_dir/src/ngx_http_drizzle_util.h $ngx_addon_dir/src/ngx_http_drizzle_output.h $ngx_addon_dir/src/resty_dbd_stream.h $ngx_addon_dir/src/ngx_http_drizzle_keepalive.h $ngx_addon_dir/src/ngx_http_drizzle_quoting.h $ngx_addon_dir/src/ngx_http_drizzle_checker.h"
++ ngx_module_deps=
++ ngx_module_libs="-L%%PREFIX%%/lib -ldrizzle"
++
++ . auto/module
++else
++ HTTP_MODULES="$HTTP_MODULES ngx_http_drizzle_module"
++ NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_drizzle_module.c $ngx_addon_dir/src/ngx_http_drizzle_handler.c $ngx_addon_dir/src/ngx_http_drizzle_processor.c $ngx_addon_dir/src/ngx_http_drizzle_upstream.c $ngx_addon_dir/src/ngx_http_drizzle_util.c $ngx_addon_dir/src/ngx_http_drizzle_output.c $ngx_addon_dir/src/ngx_http_drizzle_keepalive.c $ngx_addon_dir/src/ngx_http_drizzle_quoting.c $ngx_addon_dir/src/ngx_http_drizzle_checker.c"
++ NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/ngx_http_drizzle_module.h $ngx_addon_dir/src/ngx_http_drizzle_handler.h $ngx_addon_dir/src/ngx_http_drizzle_processor.h $ngx_addon_dir/src/ngx_http_drizzle_upstream.h $ngx_addon_dir/src/ngx_http_drizzle_util.h $ngx_addon_dir/src/ngx_http_drizzle_output.h $ngx_addon_dir/src/resty_dbd_stream.h $ngx_addon_dir/src/ngx_http_drizzle_keepalive.h $ngx_addon_dir/src/ngx_http_drizzle_quoting.h $ngx_addon_dir/src/ngx_http_drizzle_checker.h"
++fi
+
+ have=NGX_DRIZZLE_MODULE . auto/have
diff --git a/www/freenginx-devel/files/extra-patch-passenger-build-nginx.rb b/www/freenginx-devel/files/extra-patch-passenger-build-nginx.rb
new file mode 100644
index 000000000000..95bf79da0865
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-passenger-build-nginx.rb
@@ -0,0 +1,33 @@
+--- ../passenger-6.0.22/build/nginx.rb.orig 2013-10-26 18:00:00.000000000 -0400
++++ ../passenger-6.0.22/build/nginx.rb 2016-05-09 18:21:22.426777000 -0400
+@@ -33,13 +33,12 @@
+ desc "Build Nginx support files"
+ task :nginx => [
+ :nginx_without_native_support,
+- NATIVE_SUPPORT_TARGET
++ LIBBOOST_OXT,
+ ].compact
+
+ desc "Build Nginx support files, including objects suitable for dynamic linking against Nginx"
+ task 'nginx:as_dynamic_module' => [
+ :nginx_dynamic_without_native_support,
+- NATIVE_SUPPORT_TARGET
+ ].compact
+
+ # Workaround for https://github.com/jimweirich/rake/issues/274
+@@ -47,7 +46,6 @@
+
+ task :nginx_without_native_support => [
+ auto_generated_sources,
+- AGENT_TARGET,
+ COMMON_LIBRARY.only(*NGINX_LIBS_SELECTOR).link_objects
+ ].flatten
+
+@@ -55,7 +53,6 @@
+ # it also creates a namespace:clean task to clean up the output_dir
+ task :nginx_dynamic_without_native_support => [
+ auto_generated_sources,
+- AGENT_TARGET,
+ define_libboost_oxt_task("nginx", NGINX_DYNAMIC_OUTPUT_DIR + "libboost_oxt", "-fPIC"),
+ COMMON_LIBRARY.only(*NGINX_LIBS_SELECTOR).
+ set_namespace("nginx").set_output_dir(NGINX_DYNAMIC_OUTPUT_DIR + "module_libpassenger_common").define_tasks("-fPIC").
diff --git a/www/freenginx-devel/files/extra-patch-passenger-disable-telemetry b/www/freenginx-devel/files/extra-patch-passenger-disable-telemetry
new file mode 100644
index 000000000000..ca2ed9f0700a
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-passenger-disable-telemetry
@@ -0,0 +1,11 @@
+--- ../passenger-6.0.22/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb.orig 2018-12-03 12:23:06.980728000 -0500
++++ ../passenger-6.0.22/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb 2018-12-03 12:23:32.978924000 -0500
+@@ -204,7 +204,7 @@
+ :name => 'passenger_disable_anonymous_telemetry',
+ :scope => :global,
+ :type => :flag,
+- :default => false,
++ :default => true,
+ :context => [:main],
+ :struct => 'NGX_HTTP_MAIN_CONF_OFFSET'
+ },
diff --git a/www/freenginx-devel/files/extra-patch-passenger_src_nginx__module_Configuration.c b/www/freenginx-devel/files/extra-patch-passenger_src_nginx__module_Configuration.c
new file mode 100644
index 000000000000..3d18184dd55e
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-passenger_src_nginx__module_Configuration.c
@@ -0,0 +1,27 @@
+--- ../passenger-6.0.22/src/nginx_module/Configuration.c.orig 2013-10-26 20:00:00.000000000 -0400
++++ ../passenger-6.0.22/src/nginx_module/Configuration.c 2024-06-04 10:53:52.178855000 -0400
+@@ -224,8 +224,10 @@
+
+ conf->upstream_config.send_lowat = NGX_CONF_UNSET_SIZE;
+ conf->upstream_config.buffer_size = NGX_CONF_UNSET_SIZE;
+- #if NGINX_VERSION_NUM >= 1007007
+- conf->upstream_config.limit_rate = NGX_CONF_UNSET_SIZE;
++ #if NGINX_VERSION_NUM >= 1027000
++ conf->upstream_config.limit_rate = NGX_CONF_UNSET_PTR;
++ #elif NGINX_VERSION_NUM >= 1007007
++ conf->upstream_config.limit_rate = NGX_CONF_UNSET_SiZE;
+ #endif
+
+ conf->upstream_config.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE;
+@@ -465,7 +467,10 @@
+ prev->upstream_config.buffer_size,
+ 16 * 1024);
+
+- #if NGINX_VERSION_NUM >= 1007007
++ #if NGINX_VERSION_NUM >= 1027000
++ ngx_conf_merge_ptr_value(conf->upstream_config.limit_rate,
++ prev->upstream_config.limit_rate, NULL);
++ #elif NGINX_VERSION_NUM >= 1007007
+ ngx_conf_merge_size_value(conf->upstream_config.limit_rate,
+ prev->upstream_config.limit_rate, 0);
+ #endif
diff --git a/www/freenginx-devel/files/extra-patch-rds-csv-nginx-module-config b/www/freenginx-devel/files/extra-patch-rds-csv-nginx-module-config
new file mode 100644
index 000000000000..040c78a481e0
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-rds-csv-nginx-module-config
@@ -0,0 +1,15 @@
+--- ../rds-csv-nginx-module-0.09/config.orig 2020-04-25 11:37:21.896900000 -0400
++++ ../rds-csv-nginx-module-0.09/config 2020-04-25 11:39:06.371176000 -0400
+@@ -1,5 +1,9 @@
+ ngx_addon_name=ngx_http_rds_csv_filter_module
+-HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_rds_csv_filter_module"
+-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_rds_csv_filter_module.c $ngx_addon_dir/src/ngx_http_rds_csv_processor.c $ngx_addon_dir/src/ngx_http_rds_csv_util.c $ngx_addon_dir/src/ngx_http_rds_csv_output.c"
+-NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/resty_dbd_stream.h $ngx_addon_dir/src/ngx_http_rds_csv_filter_module.h $ngx_addon_dir/src/ngx_http_rds_csv_processor.h $ngx_addon_dir/src/ngx_http_rds_csv_util.h $ngx_addon_dir/src/ngx_http_rds.h $ngx_addon_dir/src/resty_dbd_stream.h $ngx_addon_dir/src/ngx_http_rds_csv_output.h $ngx_addon_dir/src/ngx_http_rds_utils.h"
+
++ngx_module_name="$ngx_addon_name"
++ngx_module_type=HTTP_FILTER
++
++ngx_module_srcs="$ngx_addon_dir/src/ngx_http_rds_csv_filter_module.c $ngx_addon_dir/src/ngx_http_rds_csv_processor.c $ngx_addon_dir/src/ngx_http_rds_csv_util.c $ngx_addon_dir/src/ngx_http_rds_csv_output.c"
++ngx_module_deps="$ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/resty_dbd_stream.h $ngx_addon_dir/src/ngx_http_rds_csv_filter_module.h $ngx_addon_dir/src/ngx_http_rds_csv_processor.h $ngx_addon_dir/src/ngx_http_rds_csv_util.h $ngx_addon_dir/src/ngx_http_rds.h $ngx_addon_dir/src/resty_dbd_stream.h $ngx_addon_dir/src/ngx_http_rds_csv_output.h $ngx_addon_dir/src/ngx_http_rds_utils.h"
++
++. auto/module
diff --git a/www/freenginx-devel/files/extra-patch-rds-json-nginx-module-config b/www/freenginx-devel/files/extra-patch-rds-json-nginx-module-config
new file mode 100644
index 000000000000..f3252ac0ba50
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-rds-json-nginx-module-config
@@ -0,0 +1,15 @@
+--- ../rds-json-nginx-module-0.15/config.orig 2020-04-25 11:39:29.003855000 -0400
++++ ../rds-json-nginx-module-0.15/config 2020-04-25 11:40:18.345148000 -0400
+@@ -1,5 +1,9 @@
+ ngx_addon_name=ngx_http_rds_json_filter_module
+-HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_rds_json_filter_module"
+-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_rds_json_filter_module.c $ngx_addon_dir/src/ngx_http_rds_json_processor.c $ngx_addon_dir/src/ngx_http_rds_json_util.c $ngx_addon_dir/src/ngx_http_rds_json_output.c $ngx_addon_dir/src/ngx_http_rds_json_handler.c"
+-NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/resty_dbd_stream.h $ngx_addon_dir/src/ngx_http_rds_json_filter_module.h $ngx_addon_dir/src/ngx_http_rds_json_processor.h $ngx_addon_dir/src/ngx_http_rds_json_util.h $ngx_addon_dir/src/ngx_http_rds.h $ngx_addon_dir/src/resty_dbd_stream.h $ngx_addon_dir/src/ngx_http_rds_json_output.h $ngx_addon_dir/src/ngx_http_rds_utils.h $ngx_addon_dir/src/ngx_http_rds_json_handler.h"
+
++ngx_module_name="$ngx_addon_name"
++ngx_module_type=HTTP_FILTER
++
++ngx_module_srcs="$ngx_addon_dir/src/ngx_http_rds_json_filter_module.c $ngx_addon_dir/src/ngx_http_rds_json_processor.c $ngx_addon_dir/src/ngx_http_rds_json_util.c $ngx_addon_dir/src/ngx_http_rds_json_output.c $ngx_addon_dir/src/ngx_http_rds_json_handler.c"
++ngx_module_deps="$ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/resty_dbd_stream.h $ngx_addon_dir/src/ngx_http_rds_json_filter_module.h $ngx_addon_dir/src/ngx_http_rds_json_processor.h $ngx_addon_dir/src/ngx_http_rds_json_util.h $ngx_addon_dir/src/ngx_http_rds.h $ngx_addon_dir/src/resty_dbd_stream.h $ngx_addon_dir/src/ngx_http_rds_json_output.h $ngx_addon_dir/src/ngx_http_rds_utils.h $ngx_addon_dir/src/ngx_http_rds_json_handler.h"
++
++. auto/module
diff --git a/www/freenginx-devel/files/extra-patch-spnego-http-auth-nginx-module-config b/www/freenginx-devel/files/extra-patch-spnego-http-auth-nginx-module-config
new file mode 100644
index 000000000000..a54e89e58a23
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-spnego-http-auth-nginx-module-config
@@ -0,0 +1,14 @@
+--- ../spnego-http-auth-nginx-module-3575542/config.orig 2020-08-27 07:59:28.423636000 -0400
++++ ../spnego-http-auth-nginx-module-3575542/config 2020-08-27 08:01:42.152121000 -0400
+@@ -1,8 +1,9 @@
+ ngx_addon_name=ngx_http_auth_spnego_module
+-ngx_feature_libs="-lgssapi_krb5 -lkrb5 -lcom_err"
++ngx_feature_libs="-L%%GSSAPILIBDIR%% %%GSSAPILIBS%%"
++ngx_module_incs="%%GSSAPIINCDIR%%"
+
+ if uname -o | grep -q FreeBSD; then
+- ngx_feature_libs="$ngx_feature_libs -lgssapi"
++ ngx_feature_libs="$ngx_feature_libs"
+ fi
+
+ if uname -a | grep -q NetBSD; then
diff --git a/www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_hash_module.c b/www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_hash_module.c
new file mode 100644
index 000000000000..9267e597829f
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_hash_module.c
@@ -0,0 +1,44 @@
+--- src/http/modules/ngx_http_upstream_hash_module.c.orig 2016-02-24 14:53:24 UTC
++++ src/http/modules/ngx_http_upstream_hash_module.c
+@@ -9,6 +9,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++#include "ngx_http_upstream_check_module.h"
++#endif
+
+ typedef struct {
+ uint32_t hash;
+@@ -235,6 +238,15 @@ ngx_http_upstream_get_hash_peer(ngx_peer
+ goto next;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get hash peer, check_index: %ui",
++ peer->check_index);
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ goto next;
++ }
++#endif
++
+ if (peer->max_fails
+ && peer->fails >= peer->max_fails
+ && now - peer->checked <= peer->fail_timeout)
+@@ -535,6 +547,15 @@ ngx_http_upstream_get_chash_peer(ngx_pee
+ continue;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get consistent_hash peer, check_index: %ui",
++ peer->check_index);
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ continue;
++ }
++#endif
++
+ if (peer->server.len != server->len
+ || ngx_strncmp(peer->server.data, server->data, server->len)
+ != 0)
diff --git a/www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_ip_hash_module.c b/www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_ip_hash_module.c
new file mode 100644
index 000000000000..176876b9d23f
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_ip_hash_module.c
@@ -0,0 +1,28 @@
+--- src/http/modules/ngx_http_upstream_ip_hash_module.c.orig 2016-02-24 14:53:24 UTC
++++ src/http/modules/ngx_http_upstream_ip_hash_module.c
+@@ -9,6 +9,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++#include "ngx_http_upstream_check_module.h"
++#endif
+
+ typedef struct {
+ /* the round robin data must be first */
+@@ -205,6 +208,15 @@ ngx_http_upstream_get_ip_hash_peer(ngx_p
+ goto next;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get ip_hash peer, check_index: %ui",
++ peer->check_index);
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ goto next;
++ }
++#endif
++
+ if (peer->max_fails
+ && peer->fails >= peer->max_fails
+ && now - peer->checked <= peer->fail_timeout)
diff --git a/www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_least_conn_module.c b/www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_least_conn_module.c
new file mode 100644
index 000000000000..84f88fd4d8cd
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-src-http-modules-ngx_http_upstream_least_conn_module.c
@@ -0,0 +1,46 @@
+--- src/http/modules/ngx_http_upstream_least_conn_module.c.orig 2016-02-24 14:53:24 UTC
++++ src/http/modules/ngx_http_upstream_least_conn_module.c
+@@ -9,6 +9,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++#include "ngx_http_upstream_check_module.h"
++#endif
+
+ static ngx_int_t ngx_http_upstream_init_least_conn_peer(ngx_http_request_t *r,
+ ngx_http_upstream_srv_conf_t *us);
+@@ -148,6 +151,16 @@ ngx_http_upstream_get_least_conn_peer(ng
+ continue;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get least_conn peer, check_index: %ui",
++ peer->check_index);
++
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ continue;
++ }
++#endif
++
+ if (peer->max_fails
+ && peer->fails >= peer->max_fails
+ && now - peer->checked <= peer->fail_timeout)
+@@ -199,6 +212,16 @@ ngx_http_upstream_get_least_conn_peer(ng
+ continue;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get least_conn peer, check_index: %ui",
++ peer->check_index);
++
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ continue;
++ }
++#endif
++
+ if (peer->conns * best->weight != best->conns * peer->weight) {
+ continue;
+ }
diff --git a/www/freenginx-devel/files/extra-patch-src-http-ngx_http_upstream_round_robin.c b/www/freenginx-devel/files/extra-patch-src-http-ngx_http_upstream_round_robin.c
new file mode 100644
index 000000000000..e5012b098309
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-src-http-ngx_http_upstream_round_robin.c
@@ -0,0 +1,101 @@
+--- src/http/ngx_http_upstream_round_robin.c.orig 2016-02-24 14:53:24 UTC
++++ src/http/ngx_http_upstream_round_robin.c
+@@ -9,6 +9,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++#include "ngx_http_upstream_check_module.h"
++#endif
+
+ #define ngx_http_upstream_tries(p) ((p)->number \
+ + ((p)->next ? (p)->next->number : 0))
+@@ -96,7 +99,14 @@ ngx_http_upstream_init_round_robin(ngx_c
+ peer[n].fail_timeout = server[i].fail_timeout;
+ peer[n].down = server[i].down;
+ peer[n].server = server[i].name;
+-
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ if (!server[i].down) {
++ peer[n].check_index =
++ ngx_http_upstream_check_add_peer(cf, us, &server[i].addrs[j]);
++ } else {
++ peer[n].check_index = (ngx_uint_t) NGX_ERROR;
++ }
++#endif
+ *peerp = &peer[n];
+ peerp = &peer[n].next;
+ n++;
+@@ -159,7 +169,15 @@ ngx_http_upstream_init_round_robin(ngx_c
+ peer[n].fail_timeout = server[i].fail_timeout;
+ peer[n].down = server[i].down;
+ peer[n].server = server[i].name;
+-
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ if (!server[i].down) {
++ peer[n].check_index =
++ ngx_http_upstream_check_add_peer(cf, us, &server[i].addrs[j]);
++ }
++ else {
++ peer[n].check_index = (ngx_uint_t) NGX_ERROR;
++ }
++#endif
+ *peerp = &peer[n];
+ peerp = &peer[n].next;
+ n++;
+@@ -225,6 +243,9 @@ ngx_http_upstream_init_round_robin(ngx_c
+ peer[i].current_weight = 0;
+ peer[i].max_fails = 1;
+ peer[i].fail_timeout = 10;
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ peer[i].check_index = (ngx_uint_t) NGX_ERROR;
++#endif
+ *peerp = &peer[i];
+ peerp = &peer[i].next;
+ }
+@@ -339,6 +360,9 @@ ngx_http_upstream_create_round_robin_pee
+ peer[0].current_weight = 0;
+ peer[0].max_fails = 1;
+ peer[0].fail_timeout = 10;
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ peer[0].check_index = (ngx_uint_t) NGX_ERROR;
++#endif
+ peers->peer = peer;
+
+ } else {
+@@ -381,6 +405,9 @@ ngx_http_upstream_create_round_robin_pee
+ peer[i].current_weight = 0;
+ peer[i].max_fails = 1;
+ peer[i].fail_timeout = 10;
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ peer[i].check_index = (ngx_uint_t) NGX_ERROR;
++#endif
+ *peerp = &peer[i];
+ peerp = &peer[i].next;
+ }
+@@ -441,6 +468,12 @@ ngx_http_upstream_get_round_robin_peer(n
+ goto failed;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ goto failed;
++ }
++#endif
++
+ rrp->current = peer;
+
+ } else {
+@@ -542,6 +575,12 @@ ngx_http_upstream_get_peer(ngx_http_upst
+ continue;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ continue;
++ }
++#endif
++
+ if (peer->max_fails
+ && peer->fails >= peer->max_fails
+ && now - peer->checked <= peer->fail_timeout)
diff --git a/www/freenginx-devel/files/extra-patch-src-http-ngx_http_upstream_round_robin.h b/www/freenginx-devel/files/extra-patch-src-http-ngx_http_upstream_round_robin.h
new file mode 100644
index 000000000000..84c99aaaed61
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-src-http-ngx_http_upstream_round_robin.h
@@ -0,0 +1,14 @@
+--- src/http/ngx_http_upstream_round_robin.h.orig 2016-10-11 11:03:02.000000000 -0400
++++ src/http/ngx_http_upstream_round_robin.h 2016-10-11 19:56:33.262307000 -0400
+@@ -35,6 +35,11 @@
+
+ ngx_uint_t max_fails;
+ time_t fail_timeout;
++
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_uint_t check_index;
++#endif
++
+ ngx_msec_t slow_start;
+ ngx_msec_t start_time;
+
diff --git a/www/freenginx-devel/files/extra-patch-src_http_modules_ngx_http_slice_read_ahead.c b/www/freenginx-devel/files/extra-patch-src_http_modules_ngx_http_slice_read_ahead.c
new file mode 100644
index 000000000000..b9eb1f20a439
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-src_http_modules_ngx_http_slice_read_ahead.c
@@ -0,0 +1,456 @@
+--- src/http/modules/ngx_http_slice_filter_module.c.orig 2019-04-23 13:12:58 UTC
++++ src/http/modules/ngx_http_slice_filter_module.c
+@@ -2,6 +2,10 @@
+ /*
+ * Copyright (C) Roman Arutyunyan
+ * Copyright (C) Nginx, Inc.
++ * Copyright (C) Carey Gister
++ * Copyright (C) Metapeer, Inc.
++ *
++ * Retrieve slices with an optional look-a-head of N slices where N is a float value.
+ */
+
+
+@@ -9,13 +13,25 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++/*
++ * Location Configuration -- size is size of a slice, read_a_heads is number of
++ * blocks to look a head: 0, will not limit the number of blocks. Blocks will be
++ * retrieved as quickly as GETs can be issued and returned.
++ */
+
+ typedef struct {
+ size_t size;
++ float read_a_heads;
+ } ngx_http_slice_loc_conf_t;
+
+
+ typedef struct {
++ size_t requested_bytes;
++ size_t received_bytes;
++ size_t skipped_first_slice;
++} ngx_http_slice_read_a_head_t;
++
++typedef struct {
+ off_t start;
+ off_t end;
+ ngx_str_t range;
+@@ -23,6 +39,7 @@ typedef struct {
+ unsigned last:1;
+ unsigned active:1;
+ ngx_http_request_t *sr;
++ ngx_http_slice_read_a_head_t *read_a_head;
+ } ngx_http_slice_ctx_t;
+
+
+@@ -46,6 +63,8 @@ static char *ngx_http_slice_merge_loc_conf(ngx_conf_t
+ void *child);
+ static ngx_int_t ngx_http_slice_add_variables(ngx_conf_t *cf);
+ static ngx_int_t ngx_http_slice_init(ngx_conf_t *cf);
++static char * ngx_conf_set_float_slot(ngx_conf_t *cf, ngx_command_t *cmd,
++ void *conf);
+
+
+ static ngx_command_t ngx_http_slice_filter_commands[] = {
+@@ -57,6 +76,13 @@ static ngx_command_t ngx_http_slice_filter_commands[]
+ offsetof(ngx_http_slice_loc_conf_t, size),
+ NULL },
+
++ { ngx_string("slice_read_ahead"),
++ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
++ ngx_conf_set_float_slot,
++ NGX_HTTP_LOC_CONF_OFFSET,
++ offsetof(ngx_http_slice_loc_conf_t, read_a_heads),
++ NULL },
++
+ ngx_null_command
+ };
+
+@@ -102,11 +128,11 @@ static ngx_int_t
+ ngx_http_slice_header_filter(ngx_http_request_t *r)
+ {
+ off_t end;
+- ngx_int_t rc;
++ ngx_int_t rc, rc1;
+ ngx_table_elt_t *h;
+ ngx_http_slice_ctx_t *ctx;
+ ngx_http_slice_loc_conf_t *slcf;
+- ngx_http_slice_content_range_t cr;
++ ngx_http_slice_content_range_t cr, cr1;
+
+ ctx = ngx_http_get_module_ctx(r, ngx_http_slice_filter_module);
+ if (ctx == NULL) {
+@@ -187,6 +213,23 @@ ngx_http_slice_header_filter(ngx_http_request_t *r)
+ rc = ngx_http_next_header_filter(r);
+
+ if (r != r->main) {
++ if (ctx->read_a_head != NULL) {
++ ngx_log_debug5(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
++ "http slice header (subrequest) requested_bytes: %uz, size: %uz, range: %O/%O, end: %O",
++ ctx->read_a_head->requested_bytes, slcf->size, cr.start,
++ cr.end, end);
++
++ if (end != cr.start) {
++ ctx->read_a_head->requested_bytes +=
++ ngx_min(slcf->size,
++ (size_t) end - (size_t) cr.start);
++ }
++
++ ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
++ "http slice header (subrequest) new requested_bytes: %uz, size: %uz",
++ ctx->read_a_head->requested_bytes, slcf->size);
++ }
++
+ return rc;
+ }
+
+@@ -201,8 +244,68 @@ ngx_http_slice_header_filter(ngx_http_request_t *r)
+ ctx->end = r->headers_out.content_offset
+ + r->headers_out.content_length_n;
+
++ /* Update requested bytes for the new chunk. */
++ if (ctx->read_a_head != NULL) {
++ ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
++ "http slice header (main request, partial) requested_bytes: %uz, size: %uz, start/end (%O/%O)",
++ ctx->read_a_head->requested_bytes, slcf->size,
++ ctx->start, ctx->end);
++
++ if (ctx->end != ctx->start) {
++ ctx->read_a_head->requested_bytes +=
++ ngx_min(slcf->size,
++ (size_t) ctx->end - (size_t) ctx->start);
++ }
++
++ ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
++ "http slice header (main request, partial) new requested_bytes: %uz, size: %uz, start/end (%O/%O)",
++ ctx->read_a_head->requested_bytes, slcf->size, ctx->start, ctx->end);
++
++ /* Parse the new Content-Range, which may have been set by the Range
++ filter. If the start changed, then adjust the requested_byte count
++ by the difference between the slice start and the actual start.
++ These bytes will never be received. */
++
++ rc1 = ngx_http_slice_parse_content_range(r, &cr1);
++ ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
++ "http slice header (main request, partial): rc1: %d",
++ rc1);
++
++ if (rc1 == NGX_OK) {
++ ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
++ "http slice header (main request, partial new content range) cr1.start: %uz, cr1.end: %uz",
++ cr1.start, cr1.end);
++
++ if (cr1.start != cr.start) {
++ ctx->read_a_head->skipped_first_slice =
++ cr1.start - (slcf->size * (cr1.start / slcf->size));
++
++ ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
++ "http slice header (main request, partial) new cr.start: %uz, initial start: %uz, skipped first slice: %uz",
++ cr1.start, cr.start,
++ ctx->read_a_head->skipped_first_slice);
++ }
++ }
++ }
+ } else {
+ ctx->end = cr.complete_length;
++
++ /* Update the requested bytes for the new chunk. */
++ if (ctx->read_a_head != NULL) {
++ ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
++ "http slice header (main request, full) requested_bytes: %uz, size: %uz, start/end (%O/%O)",
++ ctx->read_a_head->requested_bytes, slcf->size, ctx->start, ctx->end);
++
++ if (ctx->end != ctx->start) {
++ ctx->read_a_head->requested_bytes +=
++ ngx_min(slcf->size,
++ (size_t) ctx->end - (size_t) ctx->start);
++ }
++
++ ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
++ "http slice header (main request, full) new requested_bytes: %uz, size: %uz, start/end (%O/%O)",
++ ctx->read_a_head->requested_bytes, slcf->size, ctx->start, ctx->end);
++ }
+ }
+
+ return rc;
+@@ -216,14 +319,31 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_
+ ngx_chain_t *cl;
+ ngx_http_slice_ctx_t *ctx;
+ ngx_http_slice_loc_conf_t *slcf;
++ size_t received, read_a_head_window, read_a_head_size;
+
+ ctx = ngx_http_get_module_ctx(r, ngx_http_slice_filter_module);
+
+- if (ctx == NULL || r != r->main) {
++ if (ctx == NULL) {
+ return ngx_http_next_body_filter(r, in);
+ }
+
++ if (r != r->main) {
++ if (ctx->read_a_head != NULL) {
++ received = 0;
++ for (cl = in; cl; cl = cl->next) {
++ received = received + ngx_buf_size(cl->buf);
++ }
++
++ ctx->read_a_head->received_bytes += received;
++ }
++
++ return ngx_http_next_body_filter(r, in);
++ }
++
++ /* For the main request */
++ received = 0;
+ for (cl = in; cl; cl = cl->next) {
++ received = received + ngx_buf_size(cl->buf);
+ if (cl->buf->last_buf) {
+ cl->buf->last_buf = 0;
+ cl->buf->last_in_chain = 1;
+@@ -232,6 +352,10 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_
+ }
+ }
+
++ if (ctx->read_a_head != NULL) {
++ ctx->read_a_head->received_bytes += received;
++ }
++
+ rc = ngx_http_next_body_filter(r, in);
+
+ if (rc == NGX_ERROR || !ctx->last) {
+@@ -258,6 +382,20 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_
+ return rc;
+ }
+
++ slcf = ngx_http_get_module_loc_conf(r, ngx_http_slice_filter_module);
++
++ if (ctx->read_a_head != NULL) {
++ read_a_head_size = (size_t) (slcf->size * slcf->read_a_heads);
++ read_a_head_window = r->connection->sent + read_a_head_size;
++
++ if ((r->connection->sent != 0) &&
++ ((read_a_head_window + ctx->read_a_head->skipped_first_slice) < ctx->read_a_head->requested_bytes)) {
++ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
++ "http slice body filter defer subrequest: returning NGX_AGAIN");
++ return NGX_AGAIN;
++ }
++ }
++
+ if (ngx_http_subrequest(r, &r->uri, &r->args, &ctx->sr, NULL,
+ NGX_HTTP_SUBREQUEST_CLONE)
+ != NGX_OK)
+@@ -267,8 +405,6 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_
+
+ ngx_http_set_ctx(ctx->sr, ctx, ngx_http_slice_filter_module);
+
+- slcf = ngx_http_get_module_loc_conf(r, ngx_http_slice_filter_module);
+-
+ ctx->range.len = ngx_sprintf(ctx->range.data, "bytes=%O-%O", ctx->start,
+ ctx->start + (off_t) slcf->size - 1)
+ - ctx->range.data;
+@@ -287,6 +423,7 @@ ngx_http_slice_parse_content_range(ngx_http_request_t
+ ngx_http_slice_content_range_t *cr)
+ {
+ off_t start, end, complete_length, cutoff, cutlim;
++ ssize_t len;
+ u_char *p;
+ ngx_table_elt_t *h;
+
+@@ -300,6 +437,7 @@ ngx_http_slice_parse_content_range(ngx_http_request_t
+ }
+
+ p = h->value.data + 6;
++ len = h->value.len - 6;
+
+ cutoff = NGX_MAX_OFF_T_VALUE / 10;
+ cutlim = NGX_MAX_OFF_T_VALUE % 10;
+@@ -308,56 +446,62 @@ ngx_http_slice_parse_content_range(ngx_http_request_t
+ end = 0;
+ complete_length = 0;
+
+- while (*p == ' ') { p++; }
++ while ((*p == ' ') && (len != 0)) { p++; len--; }
+
+- if (*p < '0' || *p > '9') {
++ if ((len == 0) || (*p < '0' || *p > '9')) {
+ return NGX_ERROR;
+ }
+
+- while (*p >= '0' && *p <= '9') {
++ while ((len != 0) && (*p >= '0' && *p <= '9')) {
+ if (start >= cutoff && (start > cutoff || *p - '0' > cutlim)) {
+ return NGX_ERROR;
+ }
+
+ start = start * 10 + (*p++ - '0');
++ len--;
+ }
+
+- while (*p == ' ') { p++; }
++ while ((len != 0) && (*p == ' ')) { p++; len--; }
+
+- if (*p++ != '-') {
++ if ((len == 0) || (*p++ != '-')) {
+ return NGX_ERROR;
+ }
+
+- while (*p == ' ') { p++; }
++ len--;
+
+- if (*p < '0' || *p > '9') {
++ while ((len != 0) && (*p == ' ')) { p++; len--; }
++
++ if ((len == 0) || (*p < '0' || *p > '9')) {
+ return NGX_ERROR;
+ }
+
+- while (*p >= '0' && *p <= '9') {
++ while ((len != 0) && (*p >= '0' && *p <= '9')) {
+ if (end >= cutoff && (end > cutoff || *p - '0' > cutlim)) {
+ return NGX_ERROR;
+ }
+
+ end = end * 10 + (*p++ - '0');
++ len--;
+ }
+
+ end++;
+
+- while (*p == ' ') { p++; }
++ while ((len != 0) && (*p == ' ')) { p++; len--; }
+
+- if (*p++ != '/') {
++ if ((len == 0) || (*p++ != '/')) {
+ return NGX_ERROR;
+ }
+
+- while (*p == ' ') { p++; }
++ len--;
+
+- if (*p != '*') {
++ while ((len != 0) && (*p == ' ')) { p++; len--; }
++
++ if ((len != 0) && (*p != '*')) {
+ if (*p < '0' || *p > '9') {
+ return NGX_ERROR;
+ }
+
+- while (*p >= '0' && *p <= '9') {
++ while ((len != 0) && (*p >= '0' && *p <= '9')) {
+ if (complete_length >= cutoff
+ && (complete_length > cutoff || *p - '0' > cutlim))
+ {
+@@ -365,16 +509,18 @@ ngx_http_slice_parse_content_range(ngx_http_request_t
+ }
+
+ complete_length = complete_length * 10 + (*p++ - '0');
++ len--;
+ }
+
+ } else {
+ complete_length = -1;
+ p++;
++ len--;
+ }
+
+- while (*p == ' ') { p++; }
++ while ((len != 0) && (*p == ' ')) { p++; len--; }
+
+- if (*p != '\0') {
++ if (len != 0) {
+ return NGX_ERROR;
+ }
+
+@@ -390,9 +536,10 @@ static ngx_int_t
+ ngx_http_slice_range_variable(ngx_http_request_t *r,
+ ngx_http_variable_value_t *v, uintptr_t data)
+ {
+- u_char *p;
+- ngx_http_slice_ctx_t *ctx;
+- ngx_http_slice_loc_conf_t *slcf;
++ u_char *p;
++ ngx_http_slice_ctx_t *ctx;
++ ngx_http_slice_loc_conf_t *slcf;
++ ngx_http_slice_read_a_head_t *read_a_head;
+
+ ctx = ngx_http_get_module_ctx(r, ngx_http_slice_filter_module);
+
+@@ -414,6 +561,15 @@ ngx_http_slice_range_variable(ngx_http_request_t *r,
+ return NGX_ERROR;
+ }
+
++ if (slcf->read_a_heads != 0.0) {
++ read_a_head = ngx_pcalloc(r->pool, sizeof(ngx_http_slice_read_a_head_t));
++ if (read_a_head == NULL) {
++ return NGX_ERROR;
++ }
++
++ ctx->read_a_head = read_a_head;
++ }
++
+ ngx_http_set_ctx(r, ctx, ngx_http_slice_filter_module);
+
+ p = ngx_pnalloc(r->pool, sizeof("bytes=-") - 1 + 2 * NGX_OFF_T_LEN);
+@@ -488,6 +644,39 @@ ngx_http_slice_get_start(ngx_http_request_t *r)
+ }
+
+
++static char *
++ngx_conf_set_float_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
++{
++ char *p = conf;
++ float *np;
++ ngx_str_t *value;
++ ngx_conf_post_t *post;
++ ngx_int_t val;
++
++ np = (float *) (p + cmd->offset);
++
++ if (*np != (float) NGX_CONF_UNSET) {
++ return "is duplicate";
++ }
++
++ value = cf->args->elts;
++ val = ngx_atofp(value[1].data, value[1].len, 3);
++
++ *np = (float) val / 1000.0;
++
++ if (*np == (float) NGX_ERROR) {
++ return "invalid number";
++ }
++
++ if (cmd->post) {
++ post = cmd->post;
++ return post->post_handler(cf, post, np);
++ }
++
++ return NGX_CONF_OK;
++}
++
++
+ static void *
+ ngx_http_slice_create_loc_conf(ngx_conf_t *cf)
+ {
+@@ -499,6 +688,7 @@ ngx_http_slice_create_loc_conf(ngx_conf_t *cf)
+ }
+
+ slcf->size = NGX_CONF_UNSET_SIZE;
++ slcf->read_a_heads = (float) NGX_CONF_UNSET;
+
+ return slcf;
+ }
+@@ -511,6 +701,13 @@ ngx_http_slice_merge_loc_conf(ngx_conf_t *cf, void *pa
+ ngx_http_slice_loc_conf_t *conf = child;
+
+ ngx_conf_merge_size_value(conf->size, prev->size, 0);
++ ngx_conf_merge_value(conf->read_a_heads, prev->read_a_heads, 0.0);
++
++ if (conf->read_a_heads < 0.0) {
++ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "read a head must be >= 0");
++ return NGX_CONF_ERROR;
++ }
++
+
+ return NGX_CONF_OK;
+ }
diff --git a/www/freenginx-devel/files/extra-patch-stream-lua-nginx-module_config b/www/freenginx-devel/files/extra-patch-stream-lua-nginx-module_config
new file mode 100644
index 000000000000..e1dc55bf0760
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-stream-lua-nginx-module_config
@@ -0,0 +1,10 @@
+--- ../stream-lua-nginx-module-bea8a0c/config.orig 2024-06-03 15:08:47.791681000 -0400
++++ ../stream-lua-nginx-module-bea8a0c/config 2024-06-03 15:08:58.714542000 -0400
+@@ -411,6 +411,6 @@
+ #NGX_DTRACE_PROVIDERS="$NGX_DTRACE_PROVIDERS $ngx_addon_dir/dtrace/ngx_lua_provider.d"
+ #NGX_TAPSET_SRCS="$NGX_TAPSET_SRCS $ngx_addon_dir/tapset/ngx_lua.stp"
+
+-CORE_INCS="$CORE_INCS $ngx_addon_dir/src/api"
++CORE_INCS="$CORE_INCS src/stream $ngx_addon_dir/src/api"
+
+ echo "/* DO NOT EDIT! This file was automatically generated by config */" > "$ngx_addon_dir/src/ngx_stream_lua_autoconf.h"
diff --git a/www/freenginx-devel/files/extra-patch-xss-nginx-module-config b/www/freenginx-devel/files/extra-patch-xss-nginx-module-config
new file mode 100644
index 000000000000..c5dc537b783c
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-xss-nginx-module-config
@@ -0,0 +1,15 @@
+--- ../xss-nginx-module-0.06/config.orig 2020-04-24 17:13:57.596040000 -0400
++++ ../xss-nginx-module-0.06/config 2020-04-24 17:18:16.438437000 -0400
+@@ -1,5 +1,9 @@
+ ngx_addon_name=ngx_http_xss_filter_module
+-HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_xss_filter_module"
+-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_xss_filter_module.c $ngx_addon_dir/src/ngx_http_xss_util.c"
+-NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/ngx_http_xss_filter_module.h $ngx_addon_dir/src/ngx_http_xss_util.h"
+
++ngx_module_name="$ngx_addon_name"
++ngx_module_type=HTTP_FILTER
++
++ngx_module_srcs="$ngx_addon_dir/src/ngx_http_xss_filter_module.c $ngx_addon_dir/src/ngx_http_xss_util.c"
++ngx_module_deps="$ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/ngx_http_xss_filter_module.h $ngx_addon_dir/src/ngx_http_xss_util.h"
++
++. auto/module
diff --git a/www/freenginx-devel/files/nginx.in b/www/freenginx-devel/files/nginx.in
new file mode 100644
index 000000000000..652468a97596
--- /dev/null
+++ b/www/freenginx-devel/files/nginx.in
@@ -0,0 +1,158 @@
+#!/bin/sh
+
+# PROVIDE: nginx
+# REQUIRE: LOGIN cleanvar
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable nginx:
+# nginx_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable nginx
+# nginx_profiles (str): Set to "" by default.
+# Define your profiles here.
+# nginx_pid_prefix (str): Set to "" by default.
+# When using profiles manually assign value to "nginx_"
+# for prevent collision with other PIDs names.
+# nginxlimits_enable (bool): Set to "NO" by default.
+# Set it to yes to run `limits $limits_args`
+# just before nginx starts.
+# nginx_reload_quiet (bool): Set to "NO" by default.
+# Set it to yes to suppress info output when testng config.
+# nginx_flags (str): Set to "" by default.
+# Extra flags passed to start command.
+# nginxlimits_args (str): Default to "-e -U %%WWWOWN%%"
+# Arguments of pre-start limits run.
+# nginx_http_accept_enable (bool): Set to "NO" by default.
+# Set to yes to check for accf_http kernel module
+# on start-up and load if not loaded.
+# nginx_sig_stop (str): Default to "TERM"
+
+. /etc/rc.subr
+
+name="nginx"
+rcvar=nginx_enable
+
+start_precmd="nginx_prestart"
+stop_precmd="nginx_prestop"
+restart_precmd="nginx_checkconfig"
+reload_precmd="nginx_checkconfig"
+configtest_cmd="nginx_checkconfig"
+gracefulstop_cmd="nginx_gracefulstop"
+upgrade_precmd="nginx_checkconfig"
+upgrade_cmd="nginx_upgrade"
+command="%%PREFIX%%/sbin/nginx"
+_pidprefix="%%NGINX_RUNDIR%%"
+pidfile="${_pidprefix}/${name}.pid"
+_tmpprefix="%%NGINX_TMPDIR%%"
+required_files=%%PREFIX%%/etc/nginx/nginx.conf
+extra_commands="reload configtest upgrade gracefulstop"
+
+[ -z "$nginx_enable" ] && nginx_enable="NO"
+[ -z "$nginxlimits_enable" ] && nginxlimits_enable="NO"
+[ -z "$nginxlimits_args" ] && nginxlimits_args="-e -U %%WWWOWN%%"
+[ -z "$nginx_http_accept_enable" ] && nginx_http_accept_enable="NO"
+[ -z "$nginx_reload_quiet" ] && nginx_reload_quiet="NO"
+
+load_rc_config $name
+
+if [ -n "$2" ]; then
+ profile="$2"
+ if [ "x${nginx_profiles}" != "x" ]; then
+ pidfile="${_pidprefix}/${nginx_pid_prefix}${profile}.pid"
+ eval nginx_configfile="\${nginx_${profile}_configfile:-}"
+ if [ "x${nginx_configfile}" = "x" ]; then
+ echo "You must define a configuration file (nginx_${profile}_configfile)"
+ exit 1
+ fi
+ required_files="${nginx_configfile}"
+ eval nginx_enable="\${nginx_${profile}_enable:-${nginx_enable}}"
+ eval nginx_flags="\${nginx_${profile}_flags:-${nginx_flags}}"
+ eval nginxlimits_enable="\${nginxlimits_${profile}_enable:-${nginxlimits_enable}}"
+ eval nginxlimits_args="\${nginxlimits_${profile}_args:-${nginxlimits_args}}"
+ nginx_flags="-c ${nginx_configfile} -g \"pid ${pidfile};\" ${nginx_flags}"
+ else
+ echo "$0: extra argument ignored"
+ fi
+else
+ if [ "x${nginx_profiles}" != "x" -a "x$1" != "x" ]; then
+ for profile in ${nginx_profiles}; do
+ echo "===> nginx profile: ${profile}"
+ %%PREFIX%%/etc/rc.d/nginx $1 ${profile}
+ retcode="$?"
+ if [ "0${retcode}" -ne 0 ]; then
+ failed="${profile} (${retcode}) ${failed:-}"
+ else
+ success="${profile} ${success:-}"
+ fi
+ done
+ exit 0
+ fi
+fi
+
+# tmpfs(5)
+nginx_checktmpdir()
+{
+ if [ ! -d ${_tmpprefix} ] ; then
+ install -d -o %%WWWOWN%% -g %%WWWGRP%% -m 755 ${_tmpprefix}
+ fi
+}
+
+nginx_checkconfig()
+{
+ nginx_checktmpdir
+
+ if checkyesno nginx_reload_quiet; then
+ eval ${command} ${nginx_flags} -t -q
+ else
+ echo "Performing sanity check on nginx configuration:"
+ eval ${command} ${nginx_flags} -t
+ fi
+}
+
+nginx_gracefulstop()
+{
+ echo "Performing a graceful stop:"
+ sig_stop="QUIT"
+ run_rc_command ${rc_prefix}stop $rc_extra_args || return 1
+}
+
+nginx_upgrade()
+{
+ echo "Upgrading nginx binary:"
+
+ reload_precmd=""
+ sig_reload="USR2"
+ run_rc_command ${rc_prefix}reload $rc_extra_args || return 1
+
+ sleep 1
+
+ echo "Stopping old binary:"
+
+ sig_reload="QUIT"
+ pidfile="$pidfile.oldbin"
+ run_rc_command ${rc_prefix}reload $rc_extra_args || return 1
+}
+
+nginx_prestart()
+{
+ if checkyesno nginx_http_accept_enable
+ then
+ required_modules="$required_modules accf_http accf_data"
+ fi
+
+ nginx_checkconfig
+
+ if checkyesno nginxlimits_enable
+ then
+ eval `/usr/bin/limits ${nginxlimits_args}` 2>/dev/null
+ else
+ return 0
+ fi
+}
+
+nginx_prestop()
+{
+ sig_stop="${nginx_sig_stop:-TERM}"
+}
+
+run_rc_command "$1"
diff --git a/www/freenginx-devel/files/patch-conf-nginx.conf b/www/freenginx-devel/files/patch-conf-nginx.conf
new file mode 100644
index 000000000000..fb38c9c3d9cc
--- /dev/null
+++ b/www/freenginx-devel/files/patch-conf-nginx.conf
@@ -0,0 +1,47 @@
+--- conf/nginx.conf.orig 2016-09-06 14:56:32 UTC
++++ conf/nginx.conf
+@@ -2,9 +2,14 @@
+ #user nobody;
+ worker_processes 1;
+
+-#error_log logs/error.log;
+-#error_log logs/error.log notice;
+-#error_log logs/error.log info;
++# This default error log path is compiled-in to make sure configuration parsing
++# errors are logged somewhere, especially during unattended boot when stderr
++# isn't normally logged anywhere. This path will be touched on every nginx
++# start regardless of error log location configured here. See
++# https://trac.nginx.org/nginx/ticket/147 for more info.
++#
++#error_log %%NGINX_ERRORLOG%%;
++#
+
+ #pid logs/nginx.pid;
+
+@@ -33,7 +38,7 @@ http {
+ #gzip on;
+
+ server {
+- listen 80;
++ listen %%HTTP_PORT%%;
+ server_name localhost;
+
+ #charset koi8-r;
+@@ -41,7 +46,7 @@ http {
+ #access_log logs/host.access.log main;
+
+ location / {
+- root html;
++ root %%PREFIX%%/www/nginx;
+ index index.html index.htm;
+ }
+
+@@ -51,7 +56,7 @@ http {
+ #
+ error_page 500 502 503 504 /50x.html;
+ location = /50x.html {
+- root html;
++ root %%PREFIX%%/www/nginx-dist;
+ }
+
+ # proxy the PHP scripts to Apache listening on 127.0.0.1:80
diff --git a/www/freenginx-devel/files/pkg-message.in b/www/freenginx-devel/files/pkg-message.in
new file mode 100644
index 000000000000..adde28032712
--- /dev/null
+++ b/www/freenginx-devel/files/pkg-message.in
@@ -0,0 +1,25 @@
+[
+{ type: install
+ message: <<EOM
+Recent version of the NGINX introduces dynamic modules support. In
+FreeBSD ports tree this feature was enabled by default with the DSO
+knob. Several vendor's and third-party modules have been converted
+to dynamic modules. Unset the DSO knob builds an NGINX without
+dynamic modules support.
+
+To load a module at runtime, include the new `load_module'
+directive in the main context, specifying the path to the shared
+object file for the module, enclosed in quotation marks. When you
+reload the configuration or restart NGINX, the module is loaded in.
+It is possible to specify a path relative to the source directory,
+or a full path, please see
+https://www.nginx.com/blog/dynamic-modules-nginx-1-9-11/ and
+http://nginx.org/en/docs/ngx_core_module.html#load_module for
+details.
+
+Default path for the NGINX dynamic modules is
+
+%%PREFIX%%/libexec/nginx.
+EOM
+}
+]
diff --git a/www/freenginx-devel/pkg-descr b/www/freenginx-devel/pkg-descr
new file mode 100644
index 000000000000..ab403142dc02
--- /dev/null
+++ b/www/freenginx-devel/pkg-descr
@@ -0,0 +1,8 @@
+NGINX is a high performance edge web server with the lowest memory footprint
+and the key features to build modern and efficient web infrastructure.
+
+NGINX functionality includes HTTP server, HTTP and mail reverse proxy, caching,
+load balancing, compression, request throttling, connection multiplexing and
+reuse, SSL offload and HTTP media streaming.
+
+See also: https://nginx.org/
diff --git a/www/freenginx-devel/pkg-plist b/www/freenginx-devel/pkg-plist
new file mode 100644
index 000000000000..41c20955e01a
--- /dev/null
+++ b/www/freenginx-devel/pkg-plist
@@ -0,0 +1,106 @@
+%%ETCDIR%%/koi-utf
+%%ETCDIR%%/koi-win
+%%ETCDIR%%/win-utf
+%%LINK%%include/ngx_link_func_module.h
+%%NAXSI%%%%ETCDIR%%/naxsi_core.rules
+@sample %%ETCDIR%%/fastcgi_params-dist %%ETCDIR%%/fastcgi_params
+@sample %%ETCDIR%%/mime.types-dist %%ETCDIR%%/mime.types
+@sample %%ETCDIR%%/nginx.conf-dist %%ETCDIR%%/nginx.conf
+@sample %%ETCDIR%%/scgi_params-dist %%ETCDIR%%/scgi_params
+@sample %%ETCDIR%%/uwsgi_params-dist %%ETCDIR%%/uwsgi_params
+%%DSO%%%%AJP%%libexec/freenginx/ngx_http_ajp_module.so
+%%DSO%%%%ARRAYVAR%%libexec/freenginx/ngx_http_array_var_module.so
+%%DSO%%%%AWS_AUTH%%libexec/freenginx/ngx_http_aws_auth_module.so
+%%DSO%%%%BROTLI%%libexec/freenginx/ngx_http_brotli_filter_module.so
+%%DSO%%%%BROTLI%%libexec/freenginx/ngx_http_brotli_static_module.so
+%%DSO%%%%CACHE_PURGE%%libexec/freenginx/ngx_http_cache_purge_module.so
+%%DSO%%%%CT%%libexec/freenginx/ngx_http_ssl_ct_module.so
+%%DSO%%%%CT%%libexec/freenginx/ngx_ssl_ct_module.so
+%%DSO%%%%DEVEL_KIT%%libexec/freenginx/ndk_http_module.so
+%%DSO%%%%DRIZZLE%%libexec/freenginx/ngx_http_drizzle_module.so
+%%DSO%%%%DYNAMIC_UPSTREAM%%libexec/freenginx/ngx_http_dynamic_upstream_module.so
+%%DSO%%%%ECHO%%libexec/freenginx/ngx_http_echo_module.so
+%%DSO%%%%ENCRYPTSESSION%%libexec/freenginx/ngx_http_encrypted_session_module.so
+%%DSO%%%%FIPS_CHECK%%libexec/freenginx/ngx_fips_check_module.so
+%%DSO%%%%FORMINPUT%%libexec/freenginx/ngx_http_form_input_module.so
+%%DSO%%%%GRIDFS%%libexec/freenginx/ngx_http_gridfs_module.so
+%%DSO%%%%HEADERS_MORE%%libexec/freenginx/ngx_http_headers_more_filter_module.so
+%%DSO%%%%HTTP_ACCEPT_LANGUAGE%%libexec/freenginx/ngx_http_accept_language_module.so
+%%DSO%%%%HTTP_AUTH_DIGEST%%libexec/freenginx/ngx_http_auth_digest_module.so
+%%DSO%%%%HTTP_AUTH_KRB5%%libexec/freenginx/ngx_http_auth_spnego_module.so
+%%DSO%%%%HTTP_AUTH_LDAP%%libexec/freenginx/ngx_http_auth_ldap_module.so
+%%DSO%%%%HTTP_AUTH_PAM%%libexec/freenginx/ngx_http_auth_pam_module.so
+%%DSO%%%%HTTP_DAV_EXT%%libexec/freenginx/ngx_http_dav_ext_module.so
+%%DSO%%%%HTTP_EVAL%%libexec/freenginx/ngx_http_eval_module.so
+%%DSO%%%%HTTP_FANCYINDEX%%libexec/freenginx/ngx_http_fancyindex_module.so
+%%DSO%%%%HTTP_FOOTER%%libexec/freenginx/ngx_http_footer_filter_module.so
+%%DSO%%%%HTTP_IMAGE_FILTER%%libexec/freenginx/ngx_http_image_filter_module.so
+%%DSO%%%%HTTP_IP2LOCATION%%libexec/freenginx/ngx_http_ip2location_module.so
+%%DSO%%%%HTTP_IP2PROXY%%libexec/freenginx/ngx_http_ip2proxy_module.so
+%%DSO%%%%HTTP_JSON_STATUS%%libexec/freenginx/ngx_http_json_status_module.so
+%%DSO%%%%HTTP_MOGILEFS%%libexec/freenginx/ngx_http_mogilefs_module.so
+%%DSO%%%%HTTP_NOTICE%%libexec/freenginx/ngx_http_notice_module.so
+%%DSO%%%%HTTP_PERL%%libexec/freenginx/ngx_http_perl_module.so
+%%DSO%%%%HTTP_PUSH_STREAM%%libexec/freenginx/ngx_http_push_stream_module.so
+%%DSO%%%%HTTP_PUSH%%libexec/freenginx/ngx_nchan_module.so
+%%DSO%%%%HTTP_REDIS%%libexec/freenginx/ngx_http_redis_module.so
+%%DSO%%%%HTTP_SUBS_FILTER%%libexec/freenginx/ngx_http_subs_filter_module.so
+%%DSO%%%%HTTP_TARANTOOL%%libexec/freenginx/ngx_http_tnt_module.so
+%%DSO%%%%HTTP_UPLOAD_PROGRESS%%libexec/freenginx/ngx_http_uploadprogress_module.so
+%%DSO%%%%HTTP_UPLOAD%%libexec/freenginx/ngx_http_upload_module.so
+%%DSO%%%%HTTP_UPSTREAM_FAIR%%libexec/freenginx/ngx_http_upstream_fair_module.so
+%%DSO%%%%HTTP_UPSTREAM_STICKY%%libexec/freenginx/ngx_http_sticky_module.so
+%%DSO%%%%HTTP_VIDEO_THUMBEXTRACTOR%%libexec/freenginx/ngx_http_video_thumbextractor_module.so
+%%DSO%%%%HTTP_XSLT%%libexec/freenginx/ngx_http_xslt_filter_module.so
+%%DSO%%%%HTTP_ZIP%%libexec/freenginx/ngx_http_zip_module.so
+%%DSO%%%%HTTP%%%%HTTP_GEOIP2%%libexec/freenginx/ngx_http_geoip2_module.so
+%%DSO%%%%HTTP%%%%NJS%%libexec/freenginx/ngx_http_js_module.so
+%%DSO%%%%ICONV%%libexec/freenginx/ngx_http_iconv_module.so
+%%DSO%%%%LET%%libexec/freenginx/ngx_http_let_module.so
+%%DSO%%%%LINK%%libexec/freenginx/ngx_http_link_func_module.so
+%%DSO%%%%LUA%%libexec/freenginx/ngx_http_lua_module.so
+%%DSO%%%%LUASTREAM%%libexec/freenginx/ngx_stream_lua_module.so
+%%DSO%%%%MAIL%%%%CT%%libexec/freenginx/ngx_mail_ssl_ct_module.so
+%%DSO%%%%MAIL%%libexec/freenginx/ngx_mail_module.so
+%%DSO%%%%MEMC%%libexec/freenginx/ngx_http_memc_module.so
+%%DSO%%%%MODSECURITY3%%libexec/freenginx/ngx_http_modsecurity_module.so
+%%DSO%%%%NAXSI%%libexec/freenginx/ngx_http_naxsi_module.so
+%%DSO%%%%OTEL%%libexec/freenginx/ngx_otel_module.so
+%%DSO%%%%PASSENGER%%libexec/freenginx/ngx_http_passenger_module.so
+%%DSO%%%%POSTGRES%%libexec/freenginx/ngx_postgres_module.so
+%%DSO%%%%RDS_CSV%%libexec/freenginx/ngx_http_rds_csv_filter_module.so
+%%DSO%%%%RDS_JSON%%libexec/freenginx/ngx_http_rds_json_filter_module.so
+%%DSO%%%%REDIS2%%libexec/freenginx/ngx_http_redis2_module.so
+%%DSO%%%%RTMP%%libexec/freenginx/ngx_rtmp_module.so
+%%DSO%%%%SET_MISC%%libexec/freenginx/ngx_http_set_misc_module.so
+%%DSO%%%%SHIBBOLETH%%libexec/freenginx/ngx_http_shibboleth_module.so
+%%DSO%%%%SLOWFS_CACHE%%libexec/freenginx/ngx_http_slowfs_module.so
+%%DSO%%%%SRCACHE%%libexec/freenginx/ngx_http_srcache_filter_module.so
+%%DSO%%%%STREAM%%%%CT%%libexec/freenginx/ngx_stream_ssl_ct_module.so
+%%DSO%%%%STREAM%%%%HTTP_GEOIP2%%libexec/freenginx/ngx_stream_geoip2_module.so
+%%DSO%%%%STREAM%%%%NJS%%libexec/freenginx/ngx_stream_js_module.so
+%%DSO%%%%STREAM%%libexec/freenginx/ngx_stream_module.so
+%%DSO%%%%STS%%libexec/freenginx/ngx_http_stream_server_traffic_status_module.so
+%%DSO%%%%VOD%%libexec/freenginx/ngx_http_vod_module.so
+%%DSO%%%%VTS%%libexec/freenginx/ngx_http_vhost_traffic_status_module.so
+%%DSO%%%%WEBSOCKIFY%%libexec/freenginx/ngx_http_websockify_module.so
+%%DSO%%%%XSS%%libexec/freenginx/ngx_http_xss_filter_module.so
+%%DSO%%%%ZSTD%%libexec/freenginx/ngx_http_zstd_filter_module.so
+%%DSO%%%%ZSTD%%libexec/freenginx/ngx_http_zstd_static_module.so
+%%HTTP_PERL%%%%SITE_ARCH%%/auto/freenginx/freenginx.so
+%%HTTP_PERL%%%%SITE_ARCH%%/freenginx.pm
+sbin/nginx
+share/vim/vimfiles/ftdetect/nginx.vim
+share/vim/vimfiles/ftplugin/nginx.vim
+share/vim/vimfiles/indent/nginx.vim
+share/vim/vimfiles/syntax/nginx.vim
+%%WWW%%@postexec mkdir -p -m 755 %D/www/nginx-dist
+%%WWW%%@postexec if [ ! -d %D/www/freenginx/ ] ; then ln -fs %D/www/freenginx-dist %D/www/freenginx; fi
+%%WWW%%www/nginx-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING
+%%WWW%%www/nginx-dist/index.html
+%%WWW%%www/nginx-dist/50x.html
+%%WWW%%@postexec chmod a-w %D/www/freenginx-dist
+%%WWW%%@postunexec if [ -L %D/www/freenginx ]; then rm -f %D/www/freenginx; fi
+@dir %%NGINX_TMPDIR%%
+@dir %%NGINX_LOGDIR%%
+share/man/man8/nginx.8.gz