pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

www/nginx*: add for the updates



Module Name:	pkgsrc-wip
Committed By:	Sergey A. Osokin <osa%FreeBSD.org@localhost>
Pushed By:	osa
Date:		Mon Oct 4 13:25:57 2021 -0400
Changeset:	cc6cb17b295bb77749e5722fd44fce1a4d7ed02a

Added Files:
	nginx-devel/DESCR
	nginx-devel/MESSAGE
	nginx-devel/Makefile
	nginx-devel/PLIST
	nginx-devel/distinfo
	nginx-devel/files/nginx.sh
	nginx-devel/files/smf/manifest.xml
	nginx-devel/patches/patch-auto_install
	nginx-devel/patches/patch-conf_nginx.conf
	nginx-devel/patches/patch-src_event_modules_ngx__eventport__module.c
	nginx-devel/patches/patch-src_os_unix_ngx__udp__sendmsg__chain.c
	nginx/DESCR
	nginx/MESSAGE
	nginx/Makefile
	nginx/Makefile.common
	nginx/PLIST
	nginx/distinfo
	nginx/files/nginx.sh
	nginx/files/smf/manifest.xml
	nginx/options.mk
	nginx/patches/patch-aa
	nginx/patches/patch-ab
	nginx/patches/patch-auto_cc_conf
	nginx/patches/patch-src_event_modules_ngx__eventport__module.c

Log Message:
www/nginx*: add for the updates

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=cc6cb17b295bb77749e5722fd44fce1a4d7ed02a

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 nginx-devel/DESCR                                  |  20 ++
 nginx-devel/MESSAGE                                |   9 +
 nginx-devel/Makefile                               |   8 +
 nginx-devel/PLIST                                  |  16 ++
 nginx-devel/distinfo                               |  70 +++++
 nginx-devel/files/nginx.sh                         |  19 ++
 nginx-devel/files/smf/manifest.xml                 |  34 +++
 nginx-devel/patches/patch-auto_install             |  16 ++
 nginx-devel/patches/patch-conf_nginx.conf          |  89 +++++++
 ...atch-src_event_modules_ngx__eventport__module.c |  25 ++
 .../patch-src_os_unix_ngx__udp__sendmsg__chain.c   |  16 ++
 nginx/DESCR                                        |  20 ++
 nginx/MESSAGE                                      |   9 +
 nginx/Makefile                                     |   9 +
 nginx/Makefile.common                              | 118 +++++++++
 nginx/PLIST                                        |  16 ++
 nginx/distinfo                                     |  70 +++++
 nginx/files/nginx.sh                               |  29 +++
 nginx/files/smf/manifest.xml                       |  34 +++
 nginx/options.mk                                   | 290 +++++++++++++++++++++
 nginx/patches/patch-aa                             |  93 +++++++
 nginx/patches/patch-ab                             |  16 ++
 nginx/patches/patch-auto_cc_conf                   |  15 ++
 ...atch-src_event_modules_ngx__eventport__module.c |  25 ++
 24 files changed, 1066 insertions(+)

diffs:
diff --git a/nginx-devel/DESCR b/nginx-devel/DESCR
new file mode 100644
index 0000000000..9b4c22585f
--- /dev/null
+++ b/nginx-devel/DESCR
@@ -0,0 +1,20 @@
+Nginx (pronounced engine-x) is a free, open-source, high-performance HTTP
+server and reverse proxy, as well as an IMAP/POP3 proxy server. Igor Sysoev
+started development of Nginx in 2002, with the first public release in 2004.
+Nginx now hosts nearly 12.18% (22.2M) of active sites across all domains.
+Nginx is known for its high performance, stability, rich feature set, simple
+configuration, and low resource consumption.
+
+Nginx is one of a handful of servers written to address the C10K problem.
+Unlike traditional servers, Nginx doesn't rely on threads to handle requests.
+Instead it uses a much more scalable event-driven (asynchronous) architecture.
+This architecture uses small, but more importantly, predictable amounts of
+memory under load.
+Even if you don't expect to handle thousands of simultaneous requests, you can
+still benefit from Nginx's high-performance and small memory footprint.
+Nginx scales in all directions: from the smallest VPS all the way up to
+clusters of servers.
+
+Nginx powers several high-visibility sites, such as Netflix, Hulu, Pinterest,
+CloudFlare, Airbnb, WordPress.com, GitHub, SoundCloud, Zynga, Eventbrite,
+Zappos, Media Temple, Heroku, RightScale, Engine Yard and NetDNA.
diff --git a/nginx-devel/MESSAGE b/nginx-devel/MESSAGE
new file mode 100644
index 0000000000..595f95d2b2
--- /dev/null
+++ b/nginx-devel/MESSAGE
@@ -0,0 +1,9 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2013/02/22 17:06:54 imil Exp $
+
+Consider adding something like following lines to /etc/newsyslog.conf:
+
+${NGINX_LOGDIR}/access.log ${NGINX_USER}:${NGINX_GROUP} 640 7 * 24 Z  ${NGINX_PIDDIR}/nginx.pid SIGUSR1
+${NGINX_LOGDIR}/error.log  ${NGINX_USER}:${NGINX_GROUP} 640 7 * 24 Z  ${NGINX_PIDDIR}/nginx.pid SIGUSR1
+
+===========================================================================
diff --git a/nginx-devel/Makefile b/nginx-devel/Makefile
new file mode 100644
index 0000000000..a3101ff8b2
--- /dev/null
+++ b/nginx-devel/Makefile
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.65 2021/09/15 12:37:33 adam Exp $
+
+DISTNAME=	nginx-1.21.3
+
+MAINTAINER=	imil%NetBSD.org@localhost
+
+.include "../../www/nginx/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/nginx-devel/PLIST b/nginx-devel/PLIST
new file mode 100644
index 0000000000..b0366eb81d
--- /dev/null
+++ b/nginx-devel/PLIST
@@ -0,0 +1,16 @@
+@comment $NetBSD: PLIST,v 1.5 2017/10/28 10:57:50 adam Exp $
+${PLIST.perl}${PERL5_SUB_INSTALLVENDORARCH}/auto/nginx/nginx.${SOEXT}
+${PLIST.perl}${PERL5_SUB_INSTALLVENDORARCH}/nginx.pm
+man/man8/nginx.8
+sbin/nginx
+share/examples/nginx/conf/fastcgi.conf
+share/examples/nginx/conf/fastcgi_params
+share/examples/nginx/conf/koi-utf
+share/examples/nginx/conf/koi-win
+share/examples/nginx/conf/mime.types
+${PLIST.naxsi}share/examples/nginx/conf/naxsi_core.rules
+share/examples/nginx/conf/nginx.conf
+${PLIST.uwsgi}share/examples/nginx/conf/uwsgi_params
+share/examples/nginx/conf/win-utf
+share/examples/nginx/html/50x.html
+share/examples/nginx/html/index.html
diff --git a/nginx-devel/distinfo b/nginx-devel/distinfo
new file mode 100644
index 0000000000..1e702cc4a7
--- /dev/null
+++ b/nginx-devel/distinfo
@@ -0,0 +1,70 @@
+$NetBSD: distinfo,v 1.69 2021/09/15 12:37:33 adam Exp $
+
+SHA1 (array-var-nginx-module-0.05.tar.gz) = c69fac77814947009ab783a471783b3c95a63a26
+RMD160 (array-var-nginx-module-0.05.tar.gz) = 89bd4efc04864e3e90781588a337338951ec8733
+SHA512 (array-var-nginx-module-0.05.tar.gz) = 7c9fa9b76bc7cd2473ceae6d5ffb8de26993be9293ea967908d6c4550e086affa7016df4c936fb0b79f1142dc0aa1a5f2058d417e6433b5a3497a45d7e866e84
+Size (array-var-nginx-module-0.05.tar.gz) = 11280 bytes
+SHA1 (echo-nginx-module-0.62.tar.gz) = 786ae3880fbf104e57ef4d92872fa9fa8e98623c
+RMD160 (echo-nginx-module-0.62.tar.gz) = 2a2099e0436702d42ed3bd74231c099661c14260
+SHA512 (echo-nginx-module-0.62.tar.gz) = 240896b1c559a71ca6ca87136d8535edd25b1d65ebb80d46080ad41c09ed1cec9737828f9efe260782294d660cea66cf402f4e75bba3fed26f3a94de0ae2f89b
+Size (echo-nginx-module-0.62.tar.gz) = 53329 bytes
+SHA1 (encrypted-session-nginx-module-0.08.tar.gz) = 0e36e7ae2553f1ac5566e60021c535efa065c8ab
+RMD160 (encrypted-session-nginx-module-0.08.tar.gz) = becf8617c53c463f49ad853532ce5e4a3b35e073
+SHA512 (encrypted-session-nginx-module-0.08.tar.gz) = 80651951edd69d202e991a66f531bbe0398b4f062e822bb7748411f5f597eb1d5827102ba477bb6cd2793274adf6f6d60dd89fde7645174b091143251197af69
+Size (encrypted-session-nginx-module-0.08.tar.gz) = 11802 bytes
+SHA1 (form-input-nginx-module-0.12.tar.gz) = 03d3befb5ecc6aba5f4f871d18c490e206906022
+RMD160 (form-input-nginx-module-0.12.tar.gz) = 954f13e7ef7afe0d859b543a57482c3dbdf33ced
+SHA512 (form-input-nginx-module-0.12.tar.gz) = 1c5c5ab74156cac09da44a2dcdd84f7c03c9919a23a847e63613e00e3781ecd73d5ad12446174b4fdef9d064257a31570a8dbcccc00d8266f7048e3dcde0362e
+Size (form-input-nginx-module-0.12.tar.gz) = 11090 bytes
+SHA1 (headers-more-nginx-module-0.33.tar.gz) = 7d6af910dae98f0dbc67bf77e82eab8b7da5d0b1
+RMD160 (headers-more-nginx-module-0.33.tar.gz) = fb27195a722e81f533016e693b5a6616fd6b4f72
+SHA512 (headers-more-nginx-module-0.33.tar.gz) = 13165b1b8d4be281b8bd2404fa48d456013d560bace094c81da08a35dc6a4f025a809a3ae3a42be6bbf67abbcbe41e0730aba06f905220f3baeb01e1192a7d37
+Size (headers-more-nginx-module-0.33.tar.gz) = 28130 bytes
+SHA1 (lua-nginx-module-0.10.19.tar.gz) = 1fa72fe33f6aa9884e5baf4724f112ac0a157da2
+RMD160 (lua-nginx-module-0.10.19.tar.gz) = cd8171fcadbd8f77692ab63b35d7ec66ca66983b
+SHA512 (lua-nginx-module-0.10.19.tar.gz) = 6b258bdcb45f99f9cec3df14fa6747704ab1f0005f8a2ccd4440f8ec477e3dcbf6026e1acffc9d5fecb79605248168a77bd2a26d67c98c7d5cc336f9474ef68c
+Size (lua-nginx-module-0.10.19.tar.gz) = 666942 bytes
+SHA1 (naxsi-1.3.tar.gz) = 53b347687ade9a54f19c0bf41f6c63ae56901789
+RMD160 (naxsi-1.3.tar.gz) = c8c9190fcf4e93c504e8815a813c30ee697daded
+SHA512 (naxsi-1.3.tar.gz) = d7aac69b5eceeb1b0db4741201159ade1e0e7f6f7c3e8c4afa2f8959c6c00c3b5285d5185747c2fb0b1400efda02e96799836315e7e492bb4a059b14acb2142d
+Size (naxsi-1.3.tar.gz) = 235626 bytes
+SHA1 (nginx-1.21.3.tar.gz) = 682f592180cdd91ae866a8b40c3d8762659248d7
+RMD160 (nginx-1.21.3.tar.gz) = 851ed2d5fa94048ef9937b64ce53fe18154e0b8e
+SHA512 (nginx-1.21.3.tar.gz) = 173d6d5c1471df1f5fbcf43fab19699ac509faee44a6c603f5e96ba59ac58774bbd84be5b45f5922a12b4037e4b32f875ce71c28e3e6adb70f306a2d25b40736
+Size (nginx-1.21.3.tar.gz) = 1066609 bytes
+SHA1 (nginx-dav-ext-module-3.0.0.tar.gz) = 524407402df7e73df9def85345c8bea324dceede
+RMD160 (nginx-dav-ext-module-3.0.0.tar.gz) = 8d099215bde79492565a39c3c8feb7695138138e
+SHA512 (nginx-dav-ext-module-3.0.0.tar.gz) = d0193ba90f1ef46c4e470630c4394bdf99d94fd2e3bd8be6cb2ba1655ec59944b1269025f032b79dc2c6dad366e54389ef6a6da2ddeb91d535a4027f2162fbde
+Size (nginx-dav-ext-module-3.0.0.tar.gz) = 14558 bytes
+SHA1 (nginx-rtmp-module-1.2.2.tar.gz) = fb5cf748d87dd448576d73b057855fc12cad9896
+RMD160 (nginx-rtmp-module-1.2.2.tar.gz) = a19f42e4f15214fd11ac8f334468dc400b86b5bd
+SHA512 (nginx-rtmp-module-1.2.2.tar.gz) = 3f8c803221854c4b1a06aadc6313fbfec74bd7179c0ee51d4365b26ffa8875881a6e1e48f777a9c9efbb9170ab7478a82920d5448a2c2df485503d37bb03ab81
+Size (nginx-rtmp-module-1.2.2.tar.gz) = 519934 bytes
+SHA1 (nginx_http_push_module-1.2.10.tar.gz) = 8dd32bfbccae58d0e40d2d10b183c1479ea3a5bc
+RMD160 (nginx_http_push_module-1.2.10.tar.gz) = 00601ab439d983687b3c30796c86227fdb43069c
+SHA512 (nginx_http_push_module-1.2.10.tar.gz) = f902641cab1c4c0d95d4ac59769c46512f7b9af9e1c49fea85a724d9eb7c3cb4ec2a4fbd9df196d8e0d250b73c9b352305e4e0cbbdcc310143a85e0f7d42c6a2
+Size (nginx_http_push_module-1.2.10.tar.gz) = 713615 bytes
+SHA1 (ngx_cache_purge-2.5.1.tar.gz) = 12069184d255a99a5039a7e9b1299945c6767acc
+RMD160 (ngx_cache_purge-2.5.1.tar.gz) = 35848113b920593bc99d34b1dfffd4292ce02c58
+SHA512 (ngx_cache_purge-2.5.1.tar.gz) = 3ad37b4a251fb85a9a384f87fea5ca640166e3d7173c6ed9a857b191ae5f2e93819483b5d423fcafe8a10239b571677b342cc2d2d5d62315816f1316d7d5bb76
+Size (ngx_cache_purge-2.5.1.tar.gz) = 16614 bytes
+SHA1 (ngx_devel_kit-0.3.1.tar.gz) = e15316e13a7b19a3d2502becbb26043a464a135a
+RMD160 (ngx_devel_kit-0.3.1.tar.gz) = 5c52a463544294096611aa9dec1c76e937a1aa23
+SHA512 (ngx_devel_kit-0.3.1.tar.gz) = de1e3349d8dd08e5982279b2219dc8a8006739f0409b8e0f5c50d93434beff1fbafba43e9c5ac85a5fab90afc5c0a7244a340610339c36f82f2cba7233e72de9
+Size (ngx_devel_kit-0.3.1.tar.gz) = 66542 bytes
+SHA1 (ngx_http_geoip2_module-3.3.tar.gz) = 6970ae247494c3890e166747752927c6450d0b32
+RMD160 (ngx_http_geoip2_module-3.3.tar.gz) = 7b272aad1a402ae6ca8fac873d4555afbeab7b75
+SHA512 (ngx_http_geoip2_module-3.3.tar.gz) = 06963b598c54e22d75ce837fb222f5aa6c9494c29e558ff46f1205d7159fc305414bfac4ed3288c836dcbf7628d92f26458e1992d34fc2f4b73275a32847bdc0
+Size (ngx_http_geoip2_module-3.3.tar.gz) = 8509 bytes
+SHA1 (njs-0.5.0.tar.gz) = a9cb186dbbfad7901a83f9b267cdf9eee84af374
+RMD160 (njs-0.5.0.tar.gz) = 0cb82b7930bf500e81471b9d44d87924a6043e57
+SHA512 (njs-0.5.0.tar.gz) = 182a64ba519b1a1d29ac71ffe2c9ef8e5a6f9aaf3db9f327ac926114db73b339a424801b558068fc7ae06ae88a4dea0a601c749db4b6f2b579e427181e41d11b
+Size (njs-0.5.0.tar.gz) = 505568 bytes
+SHA1 (set-misc-nginx-module-0.32.tar.gz) = 2433bb7a138c3b13812ec2af7070cdc67435918f
+RMD160 (set-misc-nginx-module-0.32.tar.gz) = eff9be78f884f7c3e09e88af6bdf4cdd9aaea05d
+SHA512 (set-misc-nginx-module-0.32.tar.gz) = 5590526f60c99630f99a49bfa9e3455baee6d58cd2a1419eab1367a838dafb87a50f5e2607aa8ac557b90dbf633dcf61069c997b3526cddc8f2fc45820a7bc3b
+Size (set-misc-nginx-module-0.32.tar.gz) = 29329 bytes
+SHA1 (patch-auto_install) = 3b3a0f9f4c005b707664554fa57a58c9e3b7de60
+SHA1 (patch-conf_nginx.conf) = ee9fbc3838cc006f6e1cddddadf6603f4941d171
+SHA1 (patch-src_event_modules_ngx__eventport__module.c) = c8e919f48d68bd5bffc4ad11d9c79dc6da3a0de2
+SHA1 (patch-src_os_unix_ngx__udp__sendmsg__chain.c) = d00e0f8bf7ff967e56e2b0d299f0e75f8cbdb3cb
diff --git a/nginx-devel/files/nginx.sh b/nginx-devel/files/nginx.sh
new file mode 100644
index 0000000000..cfaee259f8
--- /dev/null
+++ b/nginx-devel/files/nginx.sh
@@ -0,0 +1,19 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: nginx.sh,v 1.1 2013/02/22 17:06:54 imil Exp $
+#
+# PROVIDE: nginx
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="nginx"
+rcvar=${name}
+command="@PREFIX@/sbin/${name}"
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+pidfile="@VARBASE@/run/${name}.pid"
+start_precmd="ulimit -n 2048"
+extra_commands="reload"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/nginx-devel/files/smf/manifest.xml b/nginx-devel/files/smf/manifest.xml
new file mode 100644
index 0000000000..a3ea8eced5
--- /dev/null
+++ b/nginx-devel/files/smf/manifest.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type="manifest" name="export">
+  <service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1">
+    <create_default_instance enabled="false" />
+    <single_instance />
+    <dependency name='network' grouping='require_all' restart_on='error' type='service'>
+      <service_fmri value='svc:/milestone/network:default' />
+    </dependency>
+    <dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/system/filesystem/local:default' />
+    </dependency>
+    <method_context>
+      <method_environment>
+        <envvar name="LD_PRELOAD_32" value="/usr/lib/extendedFILE.so.1" />
+      </method_environment>
+    </method_context>
+    <exec_method type="method" name="start" exec="@PREFIX@/sbin/nginx -c %{config_file}" timeout_seconds="60" />
+    <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60" />
+    <exec_method type="method" name="refresh" exec=":kill -HUP" timeout_seconds="60" />
+    <property_group name="startd" type="framework">
+      <propval name="duration" type="astring" value="contract" />
+      <propval name="ignore_error" type="astring" value="core,signal" />
+    </property_group>
+    <property_group name="application" type="application">
+      <propval name="config_file" type="astring" value="@PKG_SYSCONFDIR@/nginx.conf" />
+    </property_group>
+    <template>
+      <common_name>
+        <loctext xml:lang="C">Nginx HTTP daemon</loctext>
+      </common_name>
+    </template>
+  </service>
+</service_bundle>
diff --git a/nginx-devel/patches/patch-auto_install b/nginx-devel/patches/patch-auto_install
new file mode 100644
index 0000000000..5221fd42eb
--- /dev/null
+++ b/nginx-devel/patches/patch-auto_install
@@ -0,0 +1,16 @@
+$NetBSD: patch-auto_install,v 1.2 2016/06/15 14:53:48 fhajny Exp $
+
+Do not create PID directory.
+
+--- auto/install.orig	2016-05-31 13:43:50.000000000 +0000
++++ auto/install
+@@ -148,9 +148,6 @@ install:	build $NGX_INSTALL_PERL_MODULES
+ 		|| cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PATH'
+ 	cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PREFIX/nginx.conf.default'
+ 
+-	test -d '\$(DESTDIR)`dirname "$NGX_PID_PATH"`' \\
+-		|| mkdir -p '\$(DESTDIR)`dirname "$NGX_PID_PATH"`'
+-
+ 	test -d '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`' \\
+ 		|| mkdir -p '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`'
+ 
diff --git a/nginx-devel/patches/patch-conf_nginx.conf b/nginx-devel/patches/patch-conf_nginx.conf
new file mode 100644
index 0000000000..f51b9ee0d7
--- /dev/null
+++ b/nginx-devel/patches/patch-conf_nginx.conf
@@ -0,0 +1,89 @@
+$NetBSD: patch-conf_nginx.conf,v 1.1 2013/12/05 15:04:06 imil Exp $
+
+This patch provides config file adapted to pkgsrc settings.
+
+--- conf/nginx.conf.orig	2013-11-19 10:03:47.000000000 +0000
++++ conf/nginx.conf
+@@ -1,28 +1,23 @@
+ 
+-#user  nobody;
++user   %%NGINX_USER%%  %%NGINX_GROUP%%;
+ worker_processes  1;
+ 
+-#error_log  logs/error.log;
+-#error_log  logs/error.log  notice;
+-#error_log  logs/error.log  info;
+-
+-#pid        logs/nginx.pid;
+-
+-
+ events {
++    # After increasing this value You probably should increase limit
++    # of file descriptors (for example in start_precmd in startup script)
+     worker_connections  1024;
+ }
+ 
+ 
+ http {
+-    include       mime.types;
++    include       %%PKG_SYSCONFDIR%%/mime.types;
+     default_type  application/octet-stream;
+ 
+     #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+     #                  '$status $body_bytes_sent "$http_referer" '
+     #                  '"$http_user_agent" "$http_x_forwarded_for"';
+ 
+-    #access_log  logs/access.log  main;
++    #access_log  %%NGINX_LOGDIR%%/access.log  main;
+ 
+     sendfile        on;
+     #tcp_nopush     on;
+@@ -38,10 +33,10 @@ http {
+ 
+         #charset koi8-r;
+ 
+-        #access_log  logs/host.access.log  main;
++        #access_log  %%NGINX_LOGDIR%%/host.access.log  main;
+ 
+         location / {
+-            root   html;
++            root   share/examples/nginx/html;
+             index  index.html index.htm;
+         }
+ 
+@@ -51,7 +46,7 @@ http {
+         #
+         error_page   500 502 503 504  /50x.html;
+         location = /50x.html {
+-            root   html;
++            root   share/examples/nginx/html;
+         }
+ 
+         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+@@ -67,7 +62,7 @@ http {
+         #    fastcgi_pass   127.0.0.1:9000;
+         #    fastcgi_index  index.php;
+         #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
+-        #    include        fastcgi_params;
++        #    include        %%PKG_SYSCONFDIR%%/fastcgi_params;
+         #}
+ 
+         # deny access to .htaccess files, if Apache's document root
+@@ -87,7 +82,7 @@ http {
+     #    server_name  somename  alias  another.alias;
+ 
+     #    location / {
+-    #        root   html;
++    #        root   share/examples/nginx/html;
+     #        index  index.html index.htm;
+     #    }
+     #}
+@@ -109,7 +104,7 @@ http {
+     #    ssl_prefer_server_ciphers  on;
+ 
+     #    location / {
+-    #        root   html;
++    #        root   share/examples/nginx/html;
+     #        index  index.html index.htm;
+     #    }
+     #}
diff --git a/nginx-devel/patches/patch-src_event_modules_ngx__eventport__module.c b/nginx-devel/patches/patch-src_event_modules_ngx__eventport__module.c
new file mode 100644
index 0000000000..2293ab5d92
--- /dev/null
+++ b/nginx-devel/patches/patch-src_event_modules_ngx__eventport__module.c
@@ -0,0 +1,25 @@
+$NetBSD: patch-src_event_modules_ngx__eventport__module.c,v 1.1 2017/02/14 10:10:55 fhajny Exp $
+
+Fix a situation where Nginx can stop servicing events when port_getn() returns a timeout.
+
+https://github.com/joyent/nginx/commit/bdd0c625236bc25799bd6f81dcf5d774928e8cb0
+
+--- src/event/modules/ngx_eventport_module.c.orig	2017-01-24 14:02:19.000000000 +0000
++++ src/event/modules/ngx_eventport_module.c
+@@ -468,6 +468,16 @@ ngx_eventport_process_events(ngx_cycle_t
+         ngx_time_update();
+     }
+ 
++    /*
++     * There's a long standing condition with event ports that port_getn() may
++     * return ETIME even when events are available. This would happen if we have
++     * specified a timeout to port_getn() without reaching the number of
++     * requested events.
++     */
++    if (n == -1 && err == ETIME && events > 0) {
++	    n = 0;
++    }
++
+     if (n == -1) {
+         if (err == ETIME) {
+             if (timer != NGX_TIMER_INFINITE) {
diff --git a/nginx-devel/patches/patch-src_os_unix_ngx__udp__sendmsg__chain.c b/nginx-devel/patches/patch-src_os_unix_ngx__udp__sendmsg__chain.c
new file mode 100644
index 0000000000..4e0f0c0354
--- /dev/null
+++ b/nginx-devel/patches/patch-src_os_unix_ngx__udp__sendmsg__chain.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_os_unix_ngx__udp__sendmsg__chain.c,v 1.2 2018/04/12 06:49:39 adam Exp $
+
+Fix building on NetBSD.
+
+--- src/os/unix/ngx_udp_sendmsg_chain.c.orig	2017-06-16 13:11:29.459922906 +0000
++++ src/os/unix/ngx_udp_sendmsg_chain.c
+@@ -271,7 +271,9 @@ ngx_sendmsg(ngx_connection_t *c, ngx_iov
+ 
+             pkt = (struct in_pktinfo *) CMSG_DATA(cmsg);
+             ngx_memzero(pkt, sizeof(struct in_pktinfo));
++#ifndef __NetBSD__
+             pkt->ipi_spec_dst = sin->sin_addr;
++#endif
+         }
+ 
+ #endif
diff --git a/nginx/DESCR b/nginx/DESCR
new file mode 100644
index 0000000000..9b4c22585f
--- /dev/null
+++ b/nginx/DESCR
@@ -0,0 +1,20 @@
+Nginx (pronounced engine-x) is a free, open-source, high-performance HTTP
+server and reverse proxy, as well as an IMAP/POP3 proxy server. Igor Sysoev
+started development of Nginx in 2002, with the first public release in 2004.
+Nginx now hosts nearly 12.18% (22.2M) of active sites across all domains.
+Nginx is known for its high performance, stability, rich feature set, simple
+configuration, and low resource consumption.
+
+Nginx is one of a handful of servers written to address the C10K problem.
+Unlike traditional servers, Nginx doesn't rely on threads to handle requests.
+Instead it uses a much more scalable event-driven (asynchronous) architecture.
+This architecture uses small, but more importantly, predictable amounts of
+memory under load.
+Even if you don't expect to handle thousands of simultaneous requests, you can
+still benefit from Nginx's high-performance and small memory footprint.
+Nginx scales in all directions: from the smallest VPS all the way up to
+clusters of servers.
+
+Nginx powers several high-visibility sites, such as Netflix, Hulu, Pinterest,
+CloudFlare, Airbnb, WordPress.com, GitHub, SoundCloud, Zynga, Eventbrite,
+Zappos, Media Temple, Heroku, RightScale, Engine Yard and NetDNA.
diff --git a/nginx/MESSAGE b/nginx/MESSAGE
new file mode 100644
index 0000000000..2ed0070b44
--- /dev/null
+++ b/nginx/MESSAGE
@@ -0,0 +1,9 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.3 2020/09/18 09:15:56 kim Exp $
+
+Consider adding something like following lines to /etc/newsyslog.conf:
+
+${NGINX_LOGDIR}/access.log ${NGINX_USER}:${NGINX_GROUP} 640 7 * 24 ZB ${NGINX_PIDDIR}/nginx.pid SIGUSR1
+${NGINX_LOGDIR}/error.log  ${NGINX_USER}:${NGINX_GROUP} 640 7 * 24 ZB ${NGINX_PIDDIR}/nginx.pid SIGUSR1
+
+===========================================================================
diff --git a/nginx/Makefile b/nginx/Makefile
new file mode 100644
index 0000000000..8e4b77193d
--- /dev/null
+++ b/nginx/Makefile
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.102 2021/09/15 12:37:05 adam Exp $
+
+DISTNAME=	nginx-1.20.1
+PKGREVISION=	1
+
+MAINTAINER=	joerg%NetBSD.org@localhost
+
+.include "../../www/nginx/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/nginx/Makefile.common b/nginx/Makefile.common
new file mode 100644
index 0000000000..48152e4a40
--- /dev/null
+++ b/nginx/Makefile.common
@@ -0,0 +1,118 @@
+# $NetBSD: Makefile.common,v 1.20 2020/11/25 11:40:06 jperkin Exp $
+# used by www/nginx/Makefile
+# used by www/nginx-devel/Makefile
+
+# Used by both www/nginx and www/nginx-devel
+# Do *not* add any version-specific data here, any change
+# in this file will affect both packages
+
+CATEGORIES=	www
+MASTER_SITES=	http://nginx.org/download/
+DISTFILES=	${DEFAULT_DISTFILES}
+
+HOMEPAGE=	https://nginx.org/
+COMMENT=	Lightweight HTTP server and mail proxy server
+LICENSE=	2-clause-bsd
+
+.include "../../mk/bsd.prefs.mk"
+
+NGINX_USER?=		nginx
+NGINX_GROUP?=		nginx
+NGINX_DATADIR?=		${VARBASE}/db/nginx
+NGINX_LOGDIR?=		${VARBASE}/log/nginx
+NGINX_PIDDIR?=		${VARBASE}/run
+
+BUILD_DEFS+=		NGINX_DATADIR NGINX_LOGDIR NGINX_PIDDIR VARBASE
+
+PKG_USERS_VARS+=	NGINX_USER
+PKG_GROUPS_VARS+=	NGINX_GROUP
+PKG_GROUPS=		${NGINX_GROUP}
+PKG_USERS=		${NGINX_USER}:${NGINX_GROUP}
+
+PKG_GECOS.${NGINX_USER}=	NGINX server user
+PKG_HOME.${NGINX_USER}=		${NGINX_DATADIR}
+PKG_SHELL.${NGINX_USER}=	${NOLOGIN}
+
+USE_PKGLOCALEDIR=	yes
+HAS_CONFIGURE=		yes
+CONFIGURE_ARGS+=	--user=${NGINX_USER}
+CONFIGURE_ARGS+=	--group=${NGINX_GROUP}
+CONFIGURE_ARGS+=	--with-ld-opt=-L${PREFIX}/lib\ -Wl,-R${PREFIX}/lib
+CONFIGURE_ARGS+=	--prefix=${PREFIX}
+CONFIGURE_ARGS+=	--sbin-path=${PREFIX}/sbin
+CONFIGURE_ARGS+=	--conf-path=${PKG_SYSCONFDIR}/nginx.conf
+CONFIGURE_ARGS+=	--pid-path=${NGINX_PIDDIR}/nginx.pid
+CONFIGURE_ARGS+=	--lock-path=${NGINX_DATADIR}/nginx.lock
+CONFIGURE_ARGS+=	--error-log-path=${NGINX_LOGDIR}/error.log
+CONFIGURE_ARGS+=	--http-log-path=${NGINX_LOGDIR}/access.log
+CONFIGURE_ARGS+=	--http-client-body-temp-path=${NGINX_DATADIR}/client_body_temp
+CONFIGURE_ARGS+=	--http-proxy-temp-path=${NGINX_DATADIR}/proxy_temp
+CONFIGURE_ARGS+=	--http-fastcgi-temp-path=${NGINX_DATADIR}/fstcgi_temp
+CONFIGURE_ARGS+=	--http-scgi-temp-path=${NGINX_DATADIR}/scgi_temp
+
+PKG_SYSCONFSUBDIR=	nginx
+
+.include "../../www/nginx/options.mk"
+
+EGDIR=			${PREFIX}/share/examples/nginx
+EGFILES+=		fastcgi.conf fastcgi_params koi-utf koi-win \
+			mime.types nginx.conf win-utf
+
+.for file in ${EGFILES}
+CONF_FILES+=	${EGDIR}/conf/${file} ${PKG_SYSCONFDIR}/${file}
+.  if !empty(PKG_OPTIONS:Mnaxsi)
+CONF_FILES+=	${EGDIR}/conf/naxsi_core.rules ${PKG_SYSCONFDIR}/naxsi_core.rules
+.  endif
+.endfor
+
+RCD_SCRIPTS=		nginx
+
+INSTALLATION_DIRS+=	${PKGMANDIR}/man8 sbin share/examples/nginx/conf \
+			share/examples/nginx/html
+MAKE_DIRS+=		${NGINX_PIDDIR}
+OWN_DIRS=		${NGINX_LOGDIR}
+OWN_DIRS_PERMS+=	${NGINX_DATADIR} ${NGINX_USER} ${NGINX_GROUP} 0700
+
+BUILD_TARGET=		build
+
+SUBST_CLASSES+=		paths
+SUBST_STAGE.paths=	pre-configure
+SUBST_FILES.paths=	conf/nginx.conf
+SUBST_SED.paths=	-e 's,%%PKG_SYSCONFDIR%%,${PKG_SYSCONFDIR},g'
+SUBST_SED.paths+=	-e 's,%%NGINX_LOGDIR%%,${NGINX_LOGDIR},g'
+SUBST_SED.paths+=	-e 's,%%NGINX_PIDDIR%%,${NGINX_PIDDIR},g'
+SUBST_SED.paths+=	-e 's,%%NGINX_USER%%,${NGINX_USER},g'
+SUBST_SED.paths+=	-e 's,%%NGINX_GROUP%%,${NGINX_GROUP},g'
+
+MESSAGE_SUBST+=		NGINX_LOGDIR=${NGINX_LOGDIR}
+MESSAGE_SUBST+=		NGINX_PIDDIR=${NGINX_PIDDIR}
+MESSAGE_SUBST+=		NGINX_USER=${NGINX_USER}
+MESSAGE_SUBST+=		NGINX_GROUP=${NGINX_GROUP}
+
+.if ${OPSYS} == "Darwin"
+SOEXT=		bundle
+.else
+SOEXT=		so
+.endif
+PLIST_SUBST+=	SOEXT=${SOEXT}
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${DESTDIR}${PREFIX}/sbin/nginx
+.for file in ${EGFILES}
+	${INSTALL_DATA} ${WRKSRC}/conf/${file} ${DESTDIR}${EGDIR}/conf/${file}
+.endfor
+	${INSTALL_DATA} ${WRKSRC}/html/50x.html ${DESTDIR}${EGDIR}/html/50x.html
+	${INSTALL_DATA} ${WRKSRC}/html/index.html ${DESTDIR}${EGDIR}/html/index.html
+	${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
+.if !empty(PKG_OPTIONS:Mnaxsi)
+	${INSTALL_DATA} ${WRKDIR}/${NAXSI_DISTNAME}/naxsi_config/naxsi_core.rules ${DESTDIR}${EGDIR}/conf
+.endif
+.if !empty(PKG_OPTIONS:Mperl)
+	${INSTALL_LIB_DIR} ${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx
+	${INSTALL_LIB} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.${SOEXT} \
+		${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx
+	${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \
+		${DESTDIR}${PERL5_INSTALLVENDORARCH}
+.endif
+
+.include "../../devel/zlib/buildlink3.mk"
diff --git a/nginx/PLIST b/nginx/PLIST
new file mode 100644
index 0000000000..9bdf8f5c9d
--- /dev/null
+++ b/nginx/PLIST
@@ -0,0 +1,16 @@
+@comment $NetBSD: PLIST,v 1.11 2020/06/01 06:18:51 adam Exp $
+${PLIST.perl}${PERL5_SUB_INSTALLVENDORARCH}/auto/nginx/nginx.${SOEXT}
+${PLIST.perl}${PERL5_SUB_INSTALLVENDORARCH}/nginx.pm
+man/man8/nginx.8
+sbin/nginx
+share/examples/nginx/conf/fastcgi.conf
+share/examples/nginx/conf/fastcgi_params
+share/examples/nginx/conf/koi-utf
+share/examples/nginx/conf/koi-win
+share/examples/nginx/conf/mime.types
+${PLIST.naxsi}share/examples/nginx/conf/naxsi_core.rules
+share/examples/nginx/conf/nginx.conf
+${PLIST.uwsgi}share/examples/nginx/conf/uwsgi_params
+share/examples/nginx/conf/win-utf
+share/examples/nginx/html/50x.html
+share/examples/nginx/html/index.html
diff --git a/nginx/distinfo b/nginx/distinfo
new file mode 100644
index 0000000000..a39a515540
--- /dev/null
+++ b/nginx/distinfo
@@ -0,0 +1,70 @@
+$NetBSD: distinfo,v 1.88 2021/09/15 12:37:05 adam Exp $
+
+SHA1 (array-var-nginx-module-0.05.tar.gz) = c69fac77814947009ab783a471783b3c95a63a26
+RMD160 (array-var-nginx-module-0.05.tar.gz) = 89bd4efc04864e3e90781588a337338951ec8733
+SHA512 (array-var-nginx-module-0.05.tar.gz) = 7c9fa9b76bc7cd2473ceae6d5ffb8de26993be9293ea967908d6c4550e086affa7016df4c936fb0b79f1142dc0aa1a5f2058d417e6433b5a3497a45d7e866e84
+Size (array-var-nginx-module-0.05.tar.gz) = 11280 bytes
+SHA1 (echo-nginx-module-0.62.tar.gz) = 786ae3880fbf104e57ef4d92872fa9fa8e98623c
+RMD160 (echo-nginx-module-0.62.tar.gz) = 2a2099e0436702d42ed3bd74231c099661c14260
+SHA512 (echo-nginx-module-0.62.tar.gz) = 240896b1c559a71ca6ca87136d8535edd25b1d65ebb80d46080ad41c09ed1cec9737828f9efe260782294d660cea66cf402f4e75bba3fed26f3a94de0ae2f89b
+Size (echo-nginx-module-0.62.tar.gz) = 53329 bytes
+SHA1 (encrypted-session-nginx-module-0.08.tar.gz) = 0e36e7ae2553f1ac5566e60021c535efa065c8ab
+RMD160 (encrypted-session-nginx-module-0.08.tar.gz) = becf8617c53c463f49ad853532ce5e4a3b35e073
+SHA512 (encrypted-session-nginx-module-0.08.tar.gz) = 80651951edd69d202e991a66f531bbe0398b4f062e822bb7748411f5f597eb1d5827102ba477bb6cd2793274adf6f6d60dd89fde7645174b091143251197af69
+Size (encrypted-session-nginx-module-0.08.tar.gz) = 11802 bytes
+SHA1 (form-input-nginx-module-0.12.tar.gz) = 03d3befb5ecc6aba5f4f871d18c490e206906022
+RMD160 (form-input-nginx-module-0.12.tar.gz) = 954f13e7ef7afe0d859b543a57482c3dbdf33ced
+SHA512 (form-input-nginx-module-0.12.tar.gz) = 1c5c5ab74156cac09da44a2dcdd84f7c03c9919a23a847e63613e00e3781ecd73d5ad12446174b4fdef9d064257a31570a8dbcccc00d8266f7048e3dcde0362e
+Size (form-input-nginx-module-0.12.tar.gz) = 11090 bytes
+SHA1 (headers-more-nginx-module-0.33.tar.gz) = 7d6af910dae98f0dbc67bf77e82eab8b7da5d0b1
+RMD160 (headers-more-nginx-module-0.33.tar.gz) = fb27195a722e81f533016e693b5a6616fd6b4f72
+SHA512 (headers-more-nginx-module-0.33.tar.gz) = 13165b1b8d4be281b8bd2404fa48d456013d560bace094c81da08a35dc6a4f025a809a3ae3a42be6bbf67abbcbe41e0730aba06f905220f3baeb01e1192a7d37
+Size (headers-more-nginx-module-0.33.tar.gz) = 28130 bytes
+SHA1 (lua-nginx-module-0.10.19.tar.gz) = 1fa72fe33f6aa9884e5baf4724f112ac0a157da2
+RMD160 (lua-nginx-module-0.10.19.tar.gz) = cd8171fcadbd8f77692ab63b35d7ec66ca66983b
+SHA512 (lua-nginx-module-0.10.19.tar.gz) = 6b258bdcb45f99f9cec3df14fa6747704ab1f0005f8a2ccd4440f8ec477e3dcbf6026e1acffc9d5fecb79605248168a77bd2a26d67c98c7d5cc336f9474ef68c
+Size (lua-nginx-module-0.10.19.tar.gz) = 666942 bytes
+SHA1 (naxsi-1.3.tar.gz) = 53b347687ade9a54f19c0bf41f6c63ae56901789
+RMD160 (naxsi-1.3.tar.gz) = c8c9190fcf4e93c504e8815a813c30ee697daded
+SHA512 (naxsi-1.3.tar.gz) = d7aac69b5eceeb1b0db4741201159ade1e0e7f6f7c3e8c4afa2f8959c6c00c3b5285d5185747c2fb0b1400efda02e96799836315e7e492bb4a059b14acb2142d
+Size (naxsi-1.3.tar.gz) = 235626 bytes
+SHA1 (nginx-1.20.1.tar.gz) = 6b4ab4eff3c617e133819f43fdfc14708e593a79
+RMD160 (nginx-1.20.1.tar.gz) = 760aeac8ab9ae68ad2751765487e7cb831186a13
+SHA512 (nginx-1.20.1.tar.gz) = 3d9fd4bf2740eaf20fcc3c77260a3556aaf9dff2879afc2dbb5fff364dea27313ffbc51d335e9fc9c0186a2a44dac055ef60fde0d411b8cf842fdf661478c961
+Size (nginx-1.20.1.tar.gz) = 1061461 bytes
+SHA1 (nginx-dav-ext-module-3.0.0.tar.gz) = 524407402df7e73df9def85345c8bea324dceede
+RMD160 (nginx-dav-ext-module-3.0.0.tar.gz) = 8d099215bde79492565a39c3c8feb7695138138e
+SHA512 (nginx-dav-ext-module-3.0.0.tar.gz) = d0193ba90f1ef46c4e470630c4394bdf99d94fd2e3bd8be6cb2ba1655ec59944b1269025f032b79dc2c6dad366e54389ef6a6da2ddeb91d535a4027f2162fbde
+Size (nginx-dav-ext-module-3.0.0.tar.gz) = 14558 bytes
+SHA1 (nginx-rtmp-module-1.2.2.tar.gz) = fb5cf748d87dd448576d73b057855fc12cad9896
+RMD160 (nginx-rtmp-module-1.2.2.tar.gz) = a19f42e4f15214fd11ac8f334468dc400b86b5bd
+SHA512 (nginx-rtmp-module-1.2.2.tar.gz) = 3f8c803221854c4b1a06aadc6313fbfec74bd7179c0ee51d4365b26ffa8875881a6e1e48f777a9c9efbb9170ab7478a82920d5448a2c2df485503d37bb03ab81
+Size (nginx-rtmp-module-1.2.2.tar.gz) = 519934 bytes
+SHA1 (nginx_http_push_module-1.2.10.tar.gz) = 8dd32bfbccae58d0e40d2d10b183c1479ea3a5bc
+RMD160 (nginx_http_push_module-1.2.10.tar.gz) = 00601ab439d983687b3c30796c86227fdb43069c
+SHA512 (nginx_http_push_module-1.2.10.tar.gz) = f902641cab1c4c0d95d4ac59769c46512f7b9af9e1c49fea85a724d9eb7c3cb4ec2a4fbd9df196d8e0d250b73c9b352305e4e0cbbdcc310143a85e0f7d42c6a2
+Size (nginx_http_push_module-1.2.10.tar.gz) = 713615 bytes
+SHA1 (ngx_cache_purge-2.5.1.tar.gz) = 12069184d255a99a5039a7e9b1299945c6767acc
+RMD160 (ngx_cache_purge-2.5.1.tar.gz) = 35848113b920593bc99d34b1dfffd4292ce02c58
+SHA512 (ngx_cache_purge-2.5.1.tar.gz) = 3ad37b4a251fb85a9a384f87fea5ca640166e3d7173c6ed9a857b191ae5f2e93819483b5d423fcafe8a10239b571677b342cc2d2d5d62315816f1316d7d5bb76
+Size (ngx_cache_purge-2.5.1.tar.gz) = 16614 bytes
+SHA1 (ngx_devel_kit-0.3.1.tar.gz) = e15316e13a7b19a3d2502becbb26043a464a135a
+RMD160 (ngx_devel_kit-0.3.1.tar.gz) = 5c52a463544294096611aa9dec1c76e937a1aa23
+SHA512 (ngx_devel_kit-0.3.1.tar.gz) = de1e3349d8dd08e5982279b2219dc8a8006739f0409b8e0f5c50d93434beff1fbafba43e9c5ac85a5fab90afc5c0a7244a340610339c36f82f2cba7233e72de9
+Size (ngx_devel_kit-0.3.1.tar.gz) = 66542 bytes
+SHA1 (ngx_http_geoip2_module-3.3.tar.gz) = 6970ae247494c3890e166747752927c6450d0b32
+RMD160 (ngx_http_geoip2_module-3.3.tar.gz) = 7b272aad1a402ae6ca8fac873d4555afbeab7b75
+SHA512 (ngx_http_geoip2_module-3.3.tar.gz) = 06963b598c54e22d75ce837fb222f5aa6c9494c29e558ff46f1205d7159fc305414bfac4ed3288c836dcbf7628d92f26458e1992d34fc2f4b73275a32847bdc0
+Size (ngx_http_geoip2_module-3.3.tar.gz) = 8509 bytes
+SHA1 (njs-0.5.0.tar.gz) = a9cb186dbbfad7901a83f9b267cdf9eee84af374
+RMD160 (njs-0.5.0.tar.gz) = 0cb82b7930bf500e81471b9d44d87924a6043e57
+SHA512 (njs-0.5.0.tar.gz) = 182a64ba519b1a1d29ac71ffe2c9ef8e5a6f9aaf3db9f327ac926114db73b339a424801b558068fc7ae06ae88a4dea0a601c749db4b6f2b579e427181e41d11b
+Size (njs-0.5.0.tar.gz) = 505568 bytes
+SHA1 (set-misc-nginx-module-0.32.tar.gz) = 2433bb7a138c3b13812ec2af7070cdc67435918f
+RMD160 (set-misc-nginx-module-0.32.tar.gz) = eff9be78f884f7c3e09e88af6bdf4cdd9aaea05d
+SHA512 (set-misc-nginx-module-0.32.tar.gz) = 5590526f60c99630f99a49bfa9e3455baee6d58cd2a1419eab1367a838dafb87a50f5e2607aa8ac557b90dbf633dcf61069c997b3526cddc8f2fc45820a7bc3b
+Size (set-misc-nginx-module-0.32.tar.gz) = 29329 bytes
+SHA1 (patch-aa) = 47f0c19b47b115f00ea6e9432d5bb12058c3bc1c
+SHA1 (patch-ab) = 7d126a4372aa8575ef01a4bfd9aec9898861c763
+SHA1 (patch-auto_cc_conf) = 5e6a479ba419cd16dedeb3b4c47dc685d126ef6a
+SHA1 (patch-src_event_modules_ngx__eventport__module.c) = c8e919f48d68bd5bffc4ad11d9c79dc6da3a0de2
diff --git a/nginx/files/nginx.sh b/nginx/files/nginx.sh
new file mode 100644
index 0000000000..b74922d738
--- /dev/null
+++ b/nginx/files/nginx.sh
@@ -0,0 +1,29 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: nginx.sh,v 1.3 2014/04/27 11:05:45 rodent Exp $
+#
+# PROVIDE: nginx
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="nginx"
+rcvar=${name}
+command="@PREFIX@/sbin/${name}"
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+pidfile="@VARBASE@/run/${name}.pid"
+start_precmd="ulimit -n 2048"
+extra_commands="configtest reload"
+configtest_cmd="nginx_configtest"
+
+nginx_configtest()
+{
+	if [ ! -f ${required_files} ]; then
+		warn "${required_files} does not exist."
+		return 1;
+	fi
+	${command} -t -c ${required_files}
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/nginx/files/smf/manifest.xml b/nginx/files/smf/manifest.xml
new file mode 100644
index 0000000000..a3ea8eced5
--- /dev/null
+++ b/nginx/files/smf/manifest.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type="manifest" name="export">
+  <service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1">
+    <create_default_instance enabled="false" />
+    <single_instance />
+    <dependency name='network' grouping='require_all' restart_on='error' type='service'>
+      <service_fmri value='svc:/milestone/network:default' />
+    </dependency>
+    <dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/system/filesystem/local:default' />
+    </dependency>
+    <method_context>
+      <method_environment>
+        <envvar name="LD_PRELOAD_32" value="/usr/lib/extendedFILE.so.1" />
+      </method_environment>
+    </method_context>
+    <exec_method type="method" name="start" exec="@PREFIX@/sbin/nginx -c %{config_file}" timeout_seconds="60" />
+    <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60" />
+    <exec_method type="method" name="refresh" exec=":kill -HUP" timeout_seconds="60" />
+    <property_group name="startd" type="framework">
+      <propval name="duration" type="astring" value="contract" />
+      <propval name="ignore_error" type="astring" value="core,signal" />
+    </property_group>
+    <property_group name="application" type="application">
+      <propval name="config_file" type="astring" value="@PKG_SYSCONFDIR@/nginx.conf" />
+    </property_group>
+    <template>
+      <common_name>
+        <loctext xml:lang="C">Nginx HTTP daemon</loctext>
+      </common_name>
+    </template>
+  </service>
+</service_bundle>
diff --git a/nginx/options.mk b/nginx/options.mk
new file mode 100644
index 0000000000..f09498c70c
--- /dev/null
+++ b/nginx/options.mk
@@ -0,0 +1,290 @@
+# $NetBSD: options.mk,v 1.71 2021/09/15 12:37:05 adam Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.nginx
+PKG_SUPPORTED_OPTIONS=	array-var auth-request cache-purge dav debug
+PKG_SUPPORTED_OPTIONS+=	echo encrypted-session flv form-input
+PKG_SUPPORTED_OPTIONS+=	geoip geoip2 gtools gzip headers-more http2
+PKG_SUPPORTED_OPTIONS+=	image-filter luajit mail-proxy memcache
+PKG_SUPPORTED_OPTIONS+=	naxsi njs pcre perl push realip rtmp
+PKG_SUPPORTED_OPTIONS+=	secure-link set-misc slice ssl status
+PKG_SUPPORTED_OPTIONS+=	stream-ssl-preread sub uwsgi
+PKG_SUGGESTED_OPTIONS=	pcre ssl
+
+PKG_OPTIONS_LEGACY_OPTS+=	v2:http2
+
+PLIST_VARS+=		naxsi perl uwsgi
+
+.include "../../mk/bsd.options.mk"
+
+# documentation says naxsi must be the first module
+.if !empty(PKG_OPTIONS:Mnaxsi) || make(makesum) || make(mdi) || make(distclean)
+NAXSI_VERSION=			1.3
+NAXSI_DISTNAME=			naxsi-${NAXSI_VERSION}
+NAXSI_DISTFILE=			${NAXSI_DISTNAME}.tar.gz
+SITES.${NAXSI_DISTFILE}=	-${MASTER_SITE_GITHUB:=nbs-system/naxsi/archive/}${NAXSI_VERSION}.tar.gz
+DISTFILES+=			${NAXSI_DISTFILE}
+PLIST.naxsi=			yes
+CONFIGURE_ARGS+=		--add-module=../${NAXSI_DISTNAME}/naxsi_src
+.endif
+
+.if !empty(PKG_OPTIONS:Mdebug)
+CONFIGURE_ARGS+=	--with-debug
+.endif
+
+.if !empty(PKG_OPTIONS:Mssl)
+.include "../../security/openssl/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-mail_ssl_module
+CONFIGURE_ARGS+=	--with-http_ssl_module
+SUBST_CLASSES+=		fix-ssl
+SUBST_STAGE.fix-ssl=	pre-configure
+SUBST_FILES.fix-ssl=	auto/lib/openssl/conf
+SUBST_SED.fix-ssl=	-e 's,/usr/pkg,${BUILDLINK_PREFIX.openssl},g'
+SUBST_NOOP_OK.fix-ssl=	yes
+.endif
+
+.if !empty(PKG_OPTIONS:Mpcre)
+.include "../../devel/pcre/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-pcre-jit
+SUBST_CLASSES+=		fix-pcre
+SUBST_STAGE.fix-pcre=	pre-configure
+SUBST_FILES.fix-pcre=	auto/lib/pcre/conf
+SUBST_SED.fix-pcre=	-e 's,/usr/pkg,${BUILDLINK_PREFIX.pcre},g'
+SUBST_NOOP_OK.fix-pcre=	yes
+.else
+CONFIGURE_ARGS+=	--without-pcre
+CONFIGURE_ARGS+=	--without-http_rewrite_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mdav) || make(makesum) || make(mdi) || make(distclean)
+DAV_VERSION=		3.0.0
+DAV_DISTNAME=		nginx-dav-ext-module-3.0.0
+DAV_DISTFILE=		${DAV_DISTNAME}.tar.gz
+SITES.${DAV_DISTFILE}=	-${MASTER_SITE_GITHUB:=arut/nginx-dav-ext-module/archive/}v${DAV_VERSION}.tar.gz
+DISTFILES+=		${DAV_DISTFILE}
+CONFIGURE_ARGS+=	--with-http_dav_module
+CONFIGURE_ARGS+=	--add-module=../${DAV_DISTNAME}
+.include "../../textproc/libxslt/buildlink3.mk"
+.include "../../textproc/libxml2/buildlink3.mk"
+SUBST_CLASSES+=		fix-xslt
+SUBST_STAGE.fix-xslt=	pre-configure
+SUBST_FILES.fix-xslt=	auto/lib/libxslt/conf
+SUBST_SED.fix-xslt=	-e 's,/usr/pkg,${BUILDLINK_PREFIX.libxslt},g'
+SUBST_NOOP_OK.fix-xslt=	yes
+.endif
+
+.if !empty(PKG_OPTIONS:Mflv)
+CONFIGURE_ARGS+=	--with-http_flv_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mgeoip)
+.include "../../net/GeoIP/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-http_geoip_module
+SUBST_CLASSES+=		fix-geo
+SUBST_STAGE.fix-geo=	pre-configure
+SUBST_FILES.fix-geo=	auto/lib/geoip/conf
+SUBST_SED.fix-geo=	-e 's,/usr/pkg,${BUILDLINK_PREFIX.GeoIP},g'
+SUBST_NOOP_OK.fix-geo=	yes
+.endif
+
+.if !empty(PKG_OPTIONS:Mhttp2)
+CONFIGURE_ARGS+=	--with-http_v2_module
+.endif
+
+.if !empty(PKG_OPTIONS:Msub)
+CONFIGURE_ARGS+=	--with-http_sub_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mgtools)
+CONFIGURE_ARGS+=	--with-google_perftools_module
+.include "../../devel/gperftools/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mmail-proxy)
+CONFIGURE_ARGS+=	--with-mail
+.endif
+
+.if empty(PKG_OPTIONS:Mmemcache)
+CONFIGURE_ARGS+=	--without-http_memcached_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mrealip)
+CONFIGURE_ARGS+=	--with-http_realip_module
+.endif
+
+# NDK must be added once and before 3rd party modules needing it
+.for mod in luajit set-misc array-var form-input encrypted-session
+.  if !defined(NEED_NDK) && !empty(PKG_OPTIONS:M${mod}:O)
+CONFIGURE_ARGS+=	--add-module=../${NDK_DISTNAME}
+NEED_NDK=		yes
+.  endif
+.endfor
+.if defined(NEED_NDK) || make(makesum) || make(mdi) || make(distclean)
+NDK_VERSION=		0.3.1
+NDK_DISTNAME=		ngx_devel_kit-${NDK_VERSION}
+NDK_DISTFILE=		${NDK_DISTNAME}.tar.gz
+SITES.${NDK_DISTFILE}=	-${MASTER_SITE_GITHUB:=simpl/ngx_devel_kit/archive/}v${NDK_VERSION}.tar.gz
+DISTFILES+=		${NDK_DISTFILE}
+.endif
+
+.if !empty(PKG_OPTIONS:Mluajit) || make(makesum) || make(mdi) || make(distclean)
+LUA_VERSION=		0.10.19
+LUA_DISTNAME=		lua-nginx-module-${LUA_VERSION}
+LUA_DISTFILE=		${LUA_DISTNAME}.tar.gz
+SITES.${LUA_DISTFILE}=	-${MASTER_SITE_GITHUB:=openresty/lua-nginx-module/archive/}v${LUA_VERSION}.tar.gz
+DISTFILES+=		${LUA_DISTFILE}
+.include "../../lang/LuaJIT2/buildlink3.mk"
+CONFIGURE_ENV+=		LUAJIT_LIB=${PREFIX}/lib
+CONFIGURE_ENV+=		LUAJIT_INC=${PREFIX}/include/luajit-2.0
+CONFIGURE_ARGS+=	--add-module=../${LUA_DISTNAME}
+.endif
+
+.if !empty(PKG_OPTIONS:Mecho) || make(makesum) || make(mdi) || make(distclean)
+ECHOMOD_VERSION=		0.62
+ECHOMOD_DISTNAME=		echo-nginx-module-${ECHOMOD_VERSION}
+ECHOMOD_DISTFILE=		${ECHOMOD_DISTNAME}.tar.gz
+SITES.${ECHOMOD_DISTFILE}=	-${MASTER_SITE_GITHUB:=openresty/echo-nginx-module/archive/}v${ECHOMOD_VERSION}.tar.gz
+DISTFILES+=			${ECHOMOD_DISTFILE}
+CONFIGURE_ARGS+=		--add-module=../${ECHOMOD_DISTNAME}
+.endif
+
+.if !empty(PKG_OPTIONS:Mset-misc) || make(makesum) || make(mdi) || make(distclean)
+SETMISC_VERSION=		0.32
+SETMISC_DISTNAME=		set-misc-nginx-module-${SETMISC_VERSION}
+SETMISC_DISTFILE=		${SETMISC_DISTNAME}.tar.gz
+SITES.${SETMISC_DISTFILE}=	-${MASTER_SITE_GITHUB:=openresty/set-misc-nginx-module/archive/}v${SETMISC_VERSION}.tar.gz
+DISTFILES+=			${SETMISC_DISTFILE}
+CONFIGURE_ARGS+=		--add-module=../${SETMISC_DISTNAME}
+.endif
+
+.if !empty(PKG_OPTIONS:Mgeoip2) || make(makesum) || make(mdi) || make(distclean)
+GEOIP2_VERSION=			3.3
+GEOIP2_DISTNAME=		ngx_http_geoip2_module-${GEOIP2_VERSION}
+GEOIP2_DISTFILE=		${GEOIP2_DISTNAME}.tar.gz
+SITES.${GEOIP2_DISTFILE}=	-${MASTER_SITE_GITHUB:=leev/ngx_http_geoip2_module/archive/}${GEOIP2_VERSION}.tar.gz
+DISTFILES+=			${GEOIP2_DISTFILE}
+CONFIGURE_ARGS+=		--add-module=../${GEOIP2_DISTNAME}
+.include "../../geography/libmaxminddb/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Marray-var) || make(makesum) || make(mdi) || make(distclean)
+ARRAYVAR_VERSION=		0.05
+ARRAYVAR_DISTNAME=		array-var-nginx-module-${ARRAYVAR_VERSION}
+ARRAYVAR_DISTFILE=		${ARRAYVAR_DISTNAME}.tar.gz
+SITES.${ARRAYVAR_DISTFILE}=	-${MASTER_SITE_GITHUB:=openresty/array-var-nginx-module/archive/}v${ARRAYVAR_VERSION}.tar.gz
+DISTFILES+=			${ARRAYVAR_DISTFILE}
+CONFIGURE_ARGS+=		--add-module=../${ARRAYVAR_DISTNAME}
+.endif
+
+.if !empty(PKG_OPTIONS:Mencrypted-session) || make(makesum) || make(mdi) || make(distclean)
+ENCSESS_VERSION=		0.08
+ENCSESS_DISTNAME=		encrypted-session-nginx-module-${ENCSESS_VERSION}
+ENCSESS_DISTFILE=		${ENCSESS_DISTNAME}.tar.gz
+SITES.${ENCSESS_DISTFILE}=	-${MASTER_SITE_GITHUB:=openresty/encrypted-session-nginx-module/archive/}v${ENCSESS_VERSION}.tar.gz
+DISTFILES+=			${ENCSESS_DISTFILE}
+CONFIGURE_ARGS+=		--add-module=../${ENCSESS_DISTNAME}
+.endif
+
+.if !empty(PKG_OPTIONS:Mform-input) || make(makesum) || make(mdi) || make(distclean)
+FORMINPUT_VERSION=		0.12
+FORMINPUT_DISTNAME=		form-input-nginx-module-${FORMINPUT_VERSION}
+FORMINPUT_DISTFILE=		${FORMINPUT_DISTNAME}.tar.gz
+SITES.${FORMINPUT_DISTFILE}=	-${MASTER_SITE_GITHUB:=calio/form-input-nginx-module/archive/}v${FORMINPUT_VERSION}.tar.gz
+DISTFILES+=			${FORMINPUT_DISTFILE}
+CONFIGURE_ARGS+=		--add-module=../${FORMINPUT_DISTNAME}
+.endif
+
+.if !empty(PKG_OPTIONS:Mheaders-more) || make(makesum) || make(mdi) || make(distclean)
+HEADMORE_VERSION=		0.33
+HEADMORE_DISTNAME=		headers-more-nginx-module-${HEADMORE_VERSION}
+HEADMORE_DISTFILE=		${HEADMORE_DISTNAME}.tar.gz
+SITES.${HEADMORE_DISTFILE}=	-${MASTER_SITE_GITHUB:=openresty/headers-more-nginx-module/archive/}v${HEADMORE_VERSION}.tar.gz
+DISTFILES+=			${HEADMORE_DISTFILE}
+CONFIGURE_ARGS+=		--add-module=../${HEADMORE_DISTNAME}
+.endif
+
+.if !empty(PKG_OPTIONS:Muwsgi)
+EGFILES+=		uwsgi_params
+PLIST.uwsgi=		yes
+CONFIGURE_ARGS+=	--http-uwsgi-temp-path=${NGINX_DATADIR}/uwsgi_temp
+.else
+CONFIGURE_ARGS+=	--without-http_uwsgi_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mpush) || make(makesum) || make(mdi) || make(distclean)
+PUSH_VERSION=		1.2.10
+PUSH_DISTNAME=		nginx_http_push_module-${PUSH_VERSION}
+PUSH_DISTFILE=		${PUSH_DISTNAME}.tar.gz
+SITES.${PUSH_DISTFILE}=	-${MASTER_SITE_GITHUB:=slact/nchan/archive/}v${PUSH_VERSION}.tar.gz
+DISTFILES+=		${PUSH_DISTFILE}
+CONFIGURE_ARGS+=	--add-module=../nchan-${PUSH_VERSION}
+.endif
+
+.if !empty(PKG_OPTIONS:Mimage-filter)
+.include "../../graphics/gd/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-http_image_filter_module
+SUBST_CLASSES+=		fix-gd
+SUBST_STAGE.fix-gd=	pre-configure
+SUBST_FILES.fix-gd=	auto/lib/libgd/conf
+SUBST_SED.fix-gd=	-e 's,/usr/pkg,${BUILDLINK_PREFIX.gd},g'
+SUBST_NOOP_OK.fix-gd=	yes
+.endif
+
+.if !empty(PKG_OPTIONS:Mslice)
+CONFIGURE_ARGS+=	--with-http_slice_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mstatus)
+CONFIGURE_ARGS+=	--with-http_stub_status_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mperl)
+CONFIGURE_ARGS+=	--with-http_perl_module
+CONFIGURE_ARGS+=	--with-perl=${PERL5:Q}
+INSTALLATION_DIRS+=	${PERL5_INSTALLVENDORARCH}/auto/nginx
+PLIST.perl=		yes
+.include "../../lang/perl5/dirs.mk"
+.include "../../lang/perl5/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mgzip)
+CONFIGURE_ARGS+=	--with-http_gzip_static_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mauth-request)
+CONFIGURE_ARGS+=	--with-http_auth_request_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mcache-purge) || make(makesum) || make(mdi) || make(distclean)
+CPRG_VERSION=		2.5.1
+CPRG_DISTNAME=		ngx_cache_purge-${CPRG_VERSION}
+CPRG_DISTFILE=		${CPRG_DISTNAME}.tar.gz
+SITES.${CPRG_DISTFILE}=	-${MASTER_SITE_GITHUB:=nginx-modules/ngx_cache_purge/archive/}${CPRG_VERSION}.tar.gz
+DISTFILES+=		${CPRG_DISTFILE}
+CONFIGURE_ARGS+=	--add-module=../${CPRG_DISTNAME}
+.endif
+
+.if !empty(PKG_OPTIONS:Msecure-link)
+CONFIGURE_ARGS+=	--with-http_secure_link_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mstream-ssl-preread)
+CONFIGURE_ARGS+=	--with-stream --with-stream_ssl_preread_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mrtmp) || make(makesum) || make(mdi) || make(distclean)
+RTMP_VERSION=		1.2.2
+RTMP_DISTNAME=		nginx-rtmp-module-${RTMP_VERSION}
+RTMP_DISTFILE=		${RTMP_DISTNAME}.tar.gz
+SITES.${RTMP_DISTFILE}=	-${MASTER_SITE_GITHUB:=arut/nginx-rtmp-module/archive/}v${RTMP_VERSION}.tar.gz
+DISTFILES+=		${RTMP_DISTFILE}
+CONFIGURE_ARGS+=	--add-module=../${RTMP_DISTNAME}
+.endif
+
+.if !empty(PKG_OPTIONS:Mnjs) || make(makesum) || make(mdi) || make(distclean)
+NJS_VERSION=		0.5.0
+NJS_DISTNAME=		njs-${NJS_VERSION}
+NJS_DISTFILE=		${NJS_DISTNAME}.tar.gz
+SITES.${NJS_DISTFILE}=	-${MASTER_SITE_GITHUB:=nginx/njs/archive/}${NJS_VERSION}.tar.gz
+DISTFILES+=		${NJS_DISTFILE}
+CONFIGURE_ARGS+=	--add-module=../${NJS_DISTNAME}/nginx
+.endif
diff --git a/nginx/patches/patch-aa b/nginx/patches/patch-aa
new file mode 100644
index 0000000000..d8ced5744f
--- /dev/null
+++ b/nginx/patches/patch-aa
@@ -0,0 +1,93 @@
+$NetBSD: patch-aa,v 1.4 2014/04/27 11:05:45 rodent Exp $
+
+This patch provides config file adapted to pkgsrc settings.
+
+--- conf/nginx.conf.orig	2014-04-24 12:52:24.000000000 +0000
++++ conf/nginx.conf
+@@ -1,28 +1,29 @@
+ 
+-#user  nobody;
++user   %%NGINX_USER%%  %%NGINX_GROUP%%;
+ worker_processes  1;
+ 
+-#error_log  logs/error.log;
+-#error_log  logs/error.log  notice;
+-#error_log  logs/error.log  info;
+-
+-#pid        logs/nginx.pid;
++#error_log  %%NGINX_LOGDIR%%/error.log;                                                                                                                                                                           
++#error_log  %%NGINX_LOGDIR%%/error.log  notice;                                                                                                                                                                   
++#error_log  %%NGINX_LOGDIR%%/error.log  info;
+ 
++#pid        %%NGINX_PIDDIR%%/nginx.pid;
+ 
+ events {
++    # After increasing this value You probably should increase limit
++    # of file descriptors (for example in start_precmd in startup script)
+     worker_connections  1024;
+ }
+ 
+ 
+ http {
+-    include       mime.types;
++    include       %%PKG_SYSCONFDIR%%/mime.types;
+     default_type  application/octet-stream;
+ 
+     #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+     #                  '$status $body_bytes_sent "$http_referer" '
+     #                  '"$http_user_agent" "$http_x_forwarded_for"';
+ 
+-    #access_log  logs/access.log  main;
++    #access_log  %%NGINX_LOGDIR%%/access.log  main;
+ 
+     sendfile        on;
+     #tcp_nopush     on;
+@@ -38,10 +39,10 @@ http {
+ 
+         #charset koi8-r;
+ 
+-        #access_log  logs/host.access.log  main;
++        #access_log  %%NGINX_LOGDIR%%/host.access.log  main;
+ 
+         location / {
+-            root   html;
++            root   share/examples/nginx/html;
+             index  index.html index.htm;
+         }
+ 
+@@ -51,7 +52,7 @@ http {
+         #
+         error_page   500 502 503 504  /50x.html;
+         location = /50x.html {
+-            root   html;
++            root   share/examples/nginx/html;
+         }
+ 
+         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+@@ -67,7 +68,7 @@ http {
+         #    fastcgi_pass   127.0.0.1:9000;
+         #    fastcgi_index  index.php;
+         #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
+-        #    include        fastcgi_params;
++        #    include        %%PKG_SYSCONFDIR%%/fastcgi_params;
+         #}
+ 
+         # deny access to .htaccess files, if Apache's document root
+@@ -87,7 +88,7 @@ http {
+     #    server_name  somename  alias  another.alias;
+ 
+     #    location / {
+-    #        root   html;
++    #        root   share/examples/nginx/html;
+     #        index  index.html index.htm;
+     #    }
+     #}
+@@ -109,7 +110,7 @@ http {
+     #    ssl_prefer_server_ciphers  on;
+ 
+     #    location / {
+-    #        root   html;
++    #        root   share/examples/nginx/html;
+     #        index  index.html index.htm;
+     #    }
+     #}
diff --git a/nginx/patches/patch-ab b/nginx/patches/patch-ab
new file mode 100644
index 0000000000..0b4ce2d2dc
--- /dev/null
+++ b/nginx/patches/patch-ab
@@ -0,0 +1,16 @@
+$NetBSD: patch-ab,v 1.3 2016/06/15 14:49:11 fhajny Exp $
+
+Workaround for /bin/sh bug on NetBSD
+
+--- auto/install.orig	2016-05-31 13:47:01.000000000 +0000
++++ auto/install
+@@ -148,9 +148,6 @@ install:	build $NGX_INSTALL_PERL_MODULES
+ 		|| cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PATH'
+ 	cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PREFIX/nginx.conf.default'
+ 
+-	test -d '\$(DESTDIR)`dirname "$NGX_PID_PATH"`' \\
+-		|| mkdir -p '\$(DESTDIR)`dirname "$NGX_PID_PATH"`'
+-
+ 	test -d '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`' \\
+ 		|| mkdir -p '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`'
+ 
diff --git a/nginx/patches/patch-auto_cc_conf b/nginx/patches/patch-auto_cc_conf
new file mode 100644
index 0000000000..23d947dcfa
--- /dev/null
+++ b/nginx/patches/patch-auto_cc_conf
@@ -0,0 +1,15 @@
+$NetBSD: patch-auto_cc_conf,v 1.1 2017/11/16 21:10:56 khorben Exp $
+
+Add support for LDFLAGS
+
+--- auto/cc/conf.orig	2017-07-11 13:24:06.000000000 +0000
++++ auto/cc/conf
+@@ -3,7 +3,7 @@
+ # Copyright (C) Nginx, Inc.
+ 
+ 
+-LINK="\$(CC)"
++LINK="\$(CC) \$(LDFLAGS)"
+ 
+ MAIN_LINK=
+ MODULE_LINK="-shared"
diff --git a/nginx/patches/patch-src_event_modules_ngx__eventport__module.c b/nginx/patches/patch-src_event_modules_ngx__eventport__module.c
new file mode 100644
index 0000000000..2293ab5d92
--- /dev/null
+++ b/nginx/patches/patch-src_event_modules_ngx__eventport__module.c
@@ -0,0 +1,25 @@
+$NetBSD: patch-src_event_modules_ngx__eventport__module.c,v 1.1 2017/02/14 10:10:55 fhajny Exp $
+
+Fix a situation where Nginx can stop servicing events when port_getn() returns a timeout.
+
+https://github.com/joyent/nginx/commit/bdd0c625236bc25799bd6f81dcf5d774928e8cb0
+
+--- src/event/modules/ngx_eventport_module.c.orig	2017-01-24 14:02:19.000000000 +0000
++++ src/event/modules/ngx_eventport_module.c
+@@ -468,6 +468,16 @@ ngx_eventport_process_events(ngx_cycle_t
+         ngx_time_update();
+     }
+ 
++    /*
++     * There's a long standing condition with event ports that port_getn() may
++     * return ETIME even when events are available. This would happen if we have
++     * specified a timeout to port_getn() without reaching the number of
++     * requested events.
++     */
++    if (n == -1 && err == ETIME && events > 0) {
++	    n = 0;
++    }
++
+     if (n == -1) {
+         if (err == ETIME) {
+             if (timer != NGX_TIMER_INFINITE) {


Home | Main Index | Thread Index | Old Index