summaryrefslogtreecommitdiff
path: root/www/freenginx-devel/files
diff options
context:
space:
mode:
authorJochen Neumeister <joneum@FreeBSD.org>2024-07-01 10:48:13 +0200
committerJochen Neumeister <joneum@FreeBSD.org>2024-07-01 10:50:20 +0200
commit08bff538e5c4809dc32ee956da5ffc1c462c3617 (patch)
treee6c94bbbfd50b8ef5df750688c2197cabc91be4c /www/freenginx-devel/files
parentgraphics/mesa-dri: Convert gallium and vulkan driver to port options (diff)
www/freenginx-devel: Add new port
Freenginx is a fork web Server from Nginx Sponsored by: Netzkommune GmbH
Diffstat (limited to 'www/freenginx-devel/files')
-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
42 files changed, 1640 insertions, 0 deletions
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
+}
+]