git: 78842f5507e0 - main - www/freenginx: add new port

From: Jochen Neumeister <joneum_at_FreeBSD.org>
Date: Sun, 25 Feb 2024 09:26:42 UTC
The branch main has been updated by joneum:

URL: https://cgit.FreeBSD.org/ports/commit/?id=78842f5507e0259442311b8288fb438f584aed4d

commit 78842f5507e0259442311b8288fb438f584aed4d
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2024-02-25 09:24:06 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2024-02-25 09:26:33 +0000

    www/freenginx: add new port
    
    Freenginx is a Robust ans small WWW server
    
    Sponsored by:   Netzkommune GmbH
---
 www/Makefile                                       |     1 +
 www/freenginx/Makefile                             |   403 +
 www/freenginx/Makefile.extmod                      |   330 +
 www/freenginx/Makefile.options.desc                |   120 +
 www/freenginx/distinfo                             |   145 +
 .../extra-patch-calio-iconv-nginx-module-config    |    19 +
 www/freenginx/files/extra-patch-httpv3             | 26867 +++++++++++++++++++
 www/freenginx/files/extra-patch-nginx-ct-LibreSSL  |    20 +
 .../extra-patch-nginx-http-footer-filter-config    |    12 +
 .../files/extra-patch-nginx-link-function-config   |    42 +
 .../files/extra-patch-nginx-notice-config          |    13 +
 ...xtra-patch-nginx-opentracing-opentracing-config |     8 +
 .../extra-patch-nginx_mod_h264_streaming-config    |    41 +
 .../files/extra-patch-nginx_mogilefs_module-config |    13 +
 .../files/extra-patch-ngx_http_auth_ldap_module.c  |    10 +
 .../files/extra-patch-ngx_http_dav_ext_module.c    |    15 +
 .../extra-patch-ngx_http_json_status_module-config |    12 +
 .../files/extra-patch-ngx_http_mogilefs_module.c   |    12 +
 .../files/extra-patch-ngx_http_notice_module.c     |    11 +
 .../files/extra-patch-ngx_http_redis_module.c      |    34 +
 .../files/extra-patch-ngx_http_sflow_config.c      |    10 +
 .../files/extra-patch-ngx_http_sflow_config.h      |    11 +
 .../files/extra-patch-ngx_http_sflow_module.c      |    59 +
 .../files/extra-patch-ngx_http_streaming_module.c  |    13 +
 .../files/extra-patch-ngx_http_tarantool-config    |    24 +
 .../extra-patch-ngx_http_uploadprogress_module.c   |    73 +
 .../files/extra-patch-ngx_link_func_module.c       |    11 +
 .../files/extra-patch-ngx_postgres-config          |    19 +
 ...tra-patch-openresty-drizzle-nginx-module-config |    42 +
 .../files/extra-patch-passenger-build-nginx.rb     |    33 +
 .../files/extra-patch-passenger-disable-telemetry  |    11 +
 .../files/extra-patch-rds-csv-nginx-module-config  |    15 +
 .../files/extra-patch-rds-json-nginx-module-config |    15 +
 ...xtra-patch-spnego-http-auth-nginx-module-config |    14 +
 ...rc-http-modules-ngx_http_upstream_hash_module.c |    44 +
 ...http-modules-ngx_http_upstream_ip_hash_module.c |    28 +
 ...p-modules-ngx_http_upstream_least_conn_module.c |    46 +
 ...-patch-src-http-ngx_http_upstream_round_robin.c |   101 +
 ...-patch-src-http-ngx_http_upstream_round_robin.h |    14 +
 ...ch-src_http_modules_ngx_http_slice_read_ahead.c |   456 +
 .../files/extra-patch-xss-nginx-module-config      |    15 +
 www/freenginx/files/nginx.in                       |   158 +
 www/freenginx/files/patch-conf-nginx.conf          |    47 +
 www/freenginx/files/pkg-message.in                 |    25 +
 www/freenginx/pkg-descr                            |     8 +
 www/freenginx/pkg-plist                            |   107 +
 46 files changed, 29527 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index 51af194f4639..7be376a08b8d 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -190,6 +190,7 @@
     SUBDIR += formication
     SUBDIR += foswiki
     SUBDIR += free-sa-devel
+    SUBDIR += freenginx
     SUBDIR += fswiki
     SUBDIR += fusionpbx
     SUBDIR += g-cows
diff --git a/www/freenginx/Makefile b/www/freenginx/Makefile
new file mode 100644
index 000000000000..cf0a932189e3
--- /dev/null
+++ b/www/freenginx/Makefile
@@ -0,0 +1,403 @@
+PORTNAME=	nginx
+PORTVERSION=	1.24.0
+PORTREVISION?=	0
+CATEGORIES=	www
+MASTER_SITES=	https://freenginx.org/download/ \
+		LOCAL/joneum
+PKGNAMEPREFIX=	free
+DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
+
+MAINTAINER?=	joneum@FreeBSD.org
+COMMENT?=	Robust and small WWW server
+WWW=		https://freenginx.com/
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+CONFLICTS_INSTALL=	nginx-devel nginx
+
+PORTSCOUT=	limit:^1\.24\.[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-devel-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 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 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=		--build=nginx-quic \
+				--with-stream_quic_module \
+				--with-http_v3_module
+HTTPV3_EXTRA_PATCHES=		${PATCHDIR}/extra-patch-httpv3:-p1
+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_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:MLUA) && empty(PORT_OPTIONS:MMODSECURITY3) && \
+    empty(PORT_OPTIONS:MPASSENGER)
+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:
+	@${MKDIR} ${WRKDIR}/naxsi-${NAXSI_NGINX_VER}
+	@${MV} ${WRKDIR}/naxsi_rules ${WRKDIR}/naxsi_src \
+		${WRKDIR}/naxsi-${NAXSI_NGINX_VER}
+
+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} -E 's!^brotli=.*!brotli="${LOCALBASE}"!' ${WRKSRC_brotli}/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
+
+# linker error acquire if --std=c99 defined, add "static" to inline function
+post-patch-HTTP_ZIP-on:
+	@${REINPLACE_CMD} \
+		's!^inline!static inline!' \
+		${WRKSRC_mod_zip}/ngx_http_zip_parsers.*
+
+post-patch-ICONV-on:
+	@${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_iconv}/config
+
+post-patch-NAXSI-on:
+	@${REINPLACE_CMD} 's!MSIZE!TOK_MSIZE!g' \
+		${WRKSRC_naxsi}/naxsi_src/libinjection/src/libinjection_sqli.c
+
+post-patch-PASSENGER-on:
+	@${REINPLACE_CMD} \
+		'177,179s!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
+
+post-patch-VOD-on:
+	@${REINPLACE_CMD} \
+		's!%%PREFIX%%!${LOCALBASE}!g' \
+		${WRKSRC_vod}/config
+
+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/Makefile.extmod b/www/freenginx/Makefile.extmod
new file mode 100644
index 000000000000..f3f6d0526210
--- /dev/null
+++ b/www/freenginx/Makefile.extmod
@@ -0,0 +1,330 @@
+### 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 CLOJURE COOKIE_FLAG 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_MP4_H264 HTTP_NOTICE HTTP_PROXY_CONNECT 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 MEMC \
+	MODSECURITY3 NAXSI OPENTRACING PASSENGER POSTGRES RDS_CSV RDS_JSON \
+	REDIS2 RTMP SET_MISC SFLOW SHIBBOLETH SLOWFS_CACHE SRCACHE STS \
+	VOD VTS XSS WEBSOCKIFY
+
+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:9aec15e:brotli
+BROTLI_VARS=		DSO_EXTMODS+=brotli
+
+CACHE_PURGE_GH_TUPLE=	nginx-modules:ngx_cache_purge:a84b0f3:cache_purge
+CACHE_PURGE_VARS=	DSO_EXTMODS+=cache_purge
+
+CLOJURE_CATEGORIES+=	java
+CLOJURE_USE=		JAVA=yes JAVA_OS=native JAVA_VERSION=1.8 \
+			JAVA_VENDOR=openjdk JAVA_BUILD=yes JAVA_RUN=yes
+CLOJURE_GH_TUPLE=	nginx-clojure:nginx-clojure:v0.6.0:clojure
+CLOJURE_CONFIGURE_ENV=	"JNI_INCS=-I${LOCALBASE}/openjdk8/include -I${LOCALBASE}/openjdk8/include/freebsd"
+CLOJURE_VARS=		DSO_EXTMODS+=clojure CLOJURE_SUBDIR=/src/c
+
+COOKIE_FLAG_GH_TUPLE=	AirisX:nginx_cookie_flag_module:c4ff449:cookie_flag
+COOKIE_FLAG_VARS=	DSO_EXTMODS+=cookie_flag
+
+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
+
+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.2: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:33b646d: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_PROXY_CONNECT_GH_TUPLE=		chobits:ngx_http_proxy_connect_module:75febef:mod_https_connect
+HTTP_PROXY_CONNECT_EXTRA_PATCHES=	${WRKSRC_mod_https_connect}/patch/proxy_connect_rewrite_102101.patch:-p1
+HTTP_PROXY_CONNECT_VARS=		DSO_EXTMODS+=mod_https_connect
+
+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_MP4_H264_MASTER_SITES=	http://h264.code-shop.com/download/:mp4streaming
+HTTP_MP4_H264_CONFIGURE_ON=	--with-cc-opt="-DLARGEFILE_SOURCE -DBUILDING_NGINX"
+HTTP_MP4_H264_DISTFILES=	nginx_mod_h264_streaming-2.2.7.tar.gz:mp4streaming
+HTTP_MP4_H264_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_streaming_module.c \
+				${PATCHDIR}/extra-patch-nginx_mod_h264_streaming-config
+HTTP_MP4_H264_VARS=		DSO_EXTDIRS+=nginx_mod_h264_streaming-2.2.7
+
+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=	Novetta:nginx-video-thumbextractor-module:28861f2:vte
+HTTP_VIDEO_THUMBEXTRACTOR_VARS=		DSO_EXTMODS+=vte
+
+HTTP_ZIP_GH_TUPLE=	evanmiller:mod_zip:39dc908: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
+
+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_MASTER_SITES=	https://www.github.com/wargio/naxsi/releases/download/${NAXSI_NGINX_VER}/:naxsi
+NAXSI_DISTFILES=	naxsi-${NAXSI_NGINX_VER}-src-with-deps.tar.gz:naxsi
+NAXSI_VARS=		DSO_EXTMODS+=naxsi NAXSI_SUBDIR=/naxsi_src
+WRKSRC_naxsi=		${WRKDIR}/naxsi-${NAXSI_NGINX_VER}
+
+NJS_GH_TUPLE=		nginx:njs:0.8.0:njs
+NJS_VARS=		DSO_EXTMODS+=njs NJS_SUBDIR=/nginx
+
+NJS_XML_IMPLIES=	NJS
+NJS_XML_LIB_DEPENDS=	libxml2.so:textproc/libxml2 \
+			libxslt.so:textproc/libxslt
+
+OPENTRACING_GH_TUPLE=		opentracing-contrib:nginx-opentracing:v0.24.0:opentracing
+OPENTRACING_LIB_DEPENDS=	libopentracing.so:devel/libopentracing
+OPENTRACING_VARS=		DSO_EXTMODS+=opentracing OPENTRACING_SUBDIR=/opentracing
+OPENTRACING_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-nginx-opentracing-opentracing-config
+
+PASSENGER_NGINX_VER=	6.0.17
+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
+
+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
diff --git a/www/freenginx/Makefile.options.desc b/www/freenginx/Makefile.options.desc
new file mode 100644
index 000000000000..dc7f5a7c47a1
--- /dev/null
+++ b/www/freenginx/Makefile.options.desc
@@ -0,0 +1,120 @@
+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
+CLOJURE_DESC=			3rd party clojure module
+COOKIE_FLAG_DESC=		3rd party cookie_flag 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_MP4_H264_DESC=		3rd party mp4/h264 module
+HTTP_NOTICE_DESC=		3rd party notice module
+HTTP_PERL_DESC=			Enable http_perl module
+HTTP_PROXY_CONNECT_DESC=	3rd party https proxy connect 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
+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
+OPENTRACING_DESC=		3rd party opentracing 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
diff --git a/www/freenginx/distinfo b/www/freenginx/distinfo
new file mode 100644
index 000000000000..4a4c3c991169
--- /dev/null
+++ b/www/freenginx/distinfo
@@ -0,0 +1,145 @@
+TIMESTAMP = 1708852054
+SHA256 (nginx-1.24.0.tar.gz) = 77a2541637b92a621e3ee76776c8b7b40cf6d707e69ba53a940283e30ff2f55d
+SIZE (nginx-1.24.0.tar.gz) = 1112471
+SHA256 (nginx_mogilefs_module-1.0.4.tar.gz) = 7ac230d30907f013dff8d435a118619ea6168aa3714dba62c6962d350c6295ae
+SIZE (nginx_mogilefs_module-1.0.4.tar.gz) = 11208
+SHA256 (nginx_mod_h264_streaming-2.2.7.tar.gz) = 6d974ba630cef59de1f60996c66b401264a345d25988a76037c2856cec756c19
+SIZE (nginx_mod_h264_streaming-2.2.7.tar.gz) = 44012
+SHA256 (ngx_http_redis-0.3.9.tar.gz) = 21f87540f0a44b23ffa5df16fb3d788bc90803b255ef14f9c26e3847a6f26f46
+SIZE (ngx_http_redis-0.3.9.tar.gz) = 13051
+SHA256 (naxsi-1.6-src-with-deps.tar.gz) = 1add95e5e473fca58b18356fd896221f98a122450d5b6e91b4352ef726f98a06
+SIZE (naxsi-1.6-src-with-deps.tar.gz) = 3352718
+SHA256 (passenger-6.0.17.tar.gz) = 385559ed1d78eb83165222d568721dcc4222bb57c1939811ecd2c4ef33937ba7
+SIZE (passenger-6.0.17.tar.gz) = 8422867
+SHA256 (msva-nginx_ajp_module-fcbb2cc_GH0.tar.gz) = 522e94c59f5783f281d868ede2adf325bf2f8ffb9e62cf8451d4b9ac0516916c
+SIZE (msva-nginx_ajp_module-fcbb2cc_GH0.tar.gz) = 110807
+SHA256 (openresty-array-var-nginx-module-v0.05_GH0.tar.gz) = c949d4be6f3442c8e2937046448dc8d8def25c0e0fa6f4e805144cea45eabe80
+SIZE (openresty-array-var-nginx-module-v0.05_GH0.tar.gz) = 11280
+SHA256 (anomalizer-ngx_aws_auth-21931b2_GH0.tar.gz) = d8a2422da96a638e9a911e4edb592954d9c0fe1576456fec9809ef4e2a0a863d
+SIZE (anomalizer-ngx_aws_auth-21931b2_GH0.tar.gz) = 15580
+SHA256 (google-ngx_brotli-9aec15e_GH0.tar.gz) = 0177b1158ff7092b9996346de28a0b296dc33addb2af4e8904794d19b4a9a808
+SIZE (google-ngx_brotli-9aec15e_GH0.tar.gz) = 16194
+SHA256 (nginx-modules-ngx_cache_purge-a84b0f3_GH0.tar.gz) = ddfd4fdd99075d906b7b75c49f56ec96b76df7951dfa54502e0f83890447031f
+SIZE (nginx-modules-ngx_cache_purge-a84b0f3_GH0.tar.gz) = 17162
+SHA256 (nginx-clojure-nginx-clojure-v0.6.0_GH0.tar.gz) = e8215cdebc3eb13f852c10e9bbbf315f2e1b75bb4dec015ca60ec29efcb86509
+SIZE (nginx-clojure-nginx-clojure-v0.6.0_GH0.tar.gz) = 786029
+SHA256 (AirisX-nginx_cookie_flag_module-c4ff449_GH0.tar.gz) = 4b8c1c1e1ed59ed85751f4bd7d68026ad5051103c8b983e05ad17eb0cdab138e
+SIZE (AirisX-nginx_cookie_flag_module-c4ff449_GH0.tar.gz) = 4713
+SHA256 (grahamedgecombe-nginx-ct-93e9884_GH0.tar.gz) = 72fdd125b9207cdda135f368095f85b943a78a4ff004d1cd217972e12b1571b2
+SIZE (grahamedgecombe-nginx-ct-93e9884_GH0.tar.gz) = 7224
+SHA256 (vision5-ngx_devel_kit-v0.3.2_GH0.tar.gz) = aa961eafb8317e0eb8da37eb6e2c9ff42267edd18b56947384e719b85188f58b
+SIZE (vision5-ngx_devel_kit-v0.3.2_GH0.tar.gz) = 66551
+SHA256 (openresty-drizzle-nginx-module-3504fc6_GH0.tar.gz) = 86076735597f14db28cffabc0ab1f233cd51aab7cf112c56e267783e7814fc65
+SIZE (openresty-drizzle-nginx-module-3504fc6_GH0.tar.gz) = 51596
+SHA256 (ZigzagAK-ngx_dynamic_upstream-960eef2_GH0.tar.gz) = 86e7c6ed6dba2d4c5f5b87ecb91f25ccdb7a08b8a88236e632114f830b9e354b
*** 28885 LINES SKIPPED ***