[Midnightbsd-cvs] mports [21049] trunk/www/nginx: nginx 1.8.1

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Mar 4 18:15:32 EST 2016


Revision: 21049
          http://svnweb.midnightbsd.org/mports/?rev=21049
Author:   laffer1
Date:     2016-03-04 18:15:31 -0500 (Fri, 04 Mar 2016)
Log Message:
-----------
nginx 1.8.1

Modified Paths:
--------------
    trunk/www/nginx/Makefile
    trunk/www/nginx/distinfo
    trunk/www/nginx/files/extra-patch-calio-iconv-nginx-module-config
    trunk/www/nginx/files/extra-patch-ngx_http_notice_module.c
    trunk/www/nginx/files/extra-patch-ngx_postgres-config
    trunk/www/nginx/files/extra-patch-passenger-build-nginx.rb
    trunk/www/nginx/files/nginx.in
    trunk/www/nginx/files/patch-conf-nginx.conf

Added Paths:
-----------
    trunk/www/nginx/files/extra-patch-nginx-modsecurity-configure
    trunk/www/nginx/files/extra-patch-ngx_http_auth_digest_module.c
    trunk/www/nginx/files/extra-patch-ngx_http_mogilefs_module.c
    trunk/www/nginx/files/extra-patch-ngx_http_sflow_module.c
    trunk/www/nginx/files/extra-patch-ngx_http_tarantool-config
    trunk/www/nginx/files/extra-patch-openresty-drizzle-nginx-module-config
    trunk/www/nginx/files/extra-patch-spnego-http-auth-nginx-module-config

Removed Paths:
-------------
    trunk/www/nginx/files/extra-patch-agentzh-set-misc-nginx-module-config
    trunk/www/nginx/files/extra-patch-chaoslawful-drizzle-nginx-module-config
    trunk/www/nginx/files/extra-patch-nginx-modsecurity-config
    trunk/www/nginx/files/extra-patch-ngx_http_upload_module.c
    trunk/www/nginx/files/extra-patch-ngx_http_upstream.h
    trunk/www/nginx/files/extra-patch-openresty-set-misc-nginx-module-config
    trunk/www/nginx/files/extra-patch-syslog_support

Modified: trunk/www/nginx/Makefile
===================================================================
--- trunk/www/nginx/Makefile	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/Makefile	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,12 +1,12 @@
 # $MidnightBSD$
 
 PORTNAME=	nginx
-PORTVERSION=	1.6.1
-
+PORTVERSION=	1.8.1
+PORTREVISION=	0
+PORTEPOCH=	2
 CATEGORIES=	www
 MASTER_SITES=	http://nginx.org/download/
-MASTER_SITES+=	${MASTER_SITE_FREEBSD_LOCAL}
-MASTER_SITE_SUBDIR=	osa
+MASTER_SITES+=	FREEBSD_LOCAL/osa
 DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
 
 MAINTAINER=	ports at MidnightBSD.org
@@ -14,6 +14,12 @@
 
 LICENSE=	bsd2
 
+USES+=		cpe
+
+CPE_VENDOR=	nginx
+CPE_PRODUCT=	nginx
+USE_GITHUB=	nodefault
+
 NO_OPTIONS_SORT=	yes
 OPTIONS_DEFINE=	\
 	DEBUG \
@@ -23,6 +29,7 @@
 	GOOGLE_PERFTOOLS \
 	HTTP \
 	HTTP_ADDITION \
+	HTTP_AUTH_REQ \
 	HTTP_CACHE \
 	HTTP_DAV \
 	HTTP_FLV \
@@ -45,21 +52,25 @@
 	MAIL_SMTP \
 	MAIL_SSL \
 	SPDY \
+	THREADS \
 	WWW \
+	AJP \
 	CACHE_PURGE \
-	CTPP2 \
+	CLOJURE \
+	CT \
 	ECHO \
 	HEADERS_MORE \
 	HTTP_ACCEPT_LANGUAGE \
 	HTTP_ACCESSKEY \
 	HTTP_AUTH_DIGEST \
+	HTTP_AUTH_KRB5 \
 	HTTP_AUTH_LDAP \
 	HTTP_AUTH_PAM \
-	HTTP_AUTH_REQ \
 	HTTP_DAV_EXT \
 	HTTP_EVAL \
 	HTTP_FANCYINDEX \
 	HTTP_FOOTER \
+	HTTP_JSON_STATUS \
 	HTTP_MOGILEFS \
 	HTTP_NOTICE \
 	HTTP_PUSH \
@@ -67,13 +78,14 @@
 	HTTP_REDIS \
 	HTTP_RESPONSE \
 	HTTP_SUBS_FILTER \
+	HTTP_TARANTOOL \
 	HTTP_UPLOAD \
 	HTTP_UPLOAD_PROGRESS \
 	HTTP_UPSTREAM_FAIR \
-	HTTP_UPSTREAM_HASH \
 	HTTP_UPSTREAM_STICKY \
 	HTTP_ZIP \
 	ARRAYVAR \
+	BROTLI \
 	DRIZZLE \
 	ENCRYPTSESSION \
 	FORMINPUT \
@@ -92,18 +104,18 @@
 	RTMP \
 	SET_MISC \
 	SFLOW \
+	SHIBBOLETH \
 	SLOWFS_CACHE \
+	SMALL_LIGHT \
 	SRCACHE \
-	SUPERVISORD \
-	SYSLOG_SUPPORT \
-	TCP_PROXY \
+	STATSD \
 	UDPLOG \
 	XRID_HEADER \
 	XSS \
 	VIDEO
 
-OPTIONS_SINGLE=		VIDEO
-OPTIONS_SINGLE_VIDEO=	HTTP_MP4 HTTP_MP4_H264
+OPTIONS_RADIO=		VIDEO
+OPTIONS_RADIO_VIDEO=	HTTP_MP4 HTTP_MP4_H264
 OPTIONS_DEFAULT=	IPV6 HTTP HTTP_CACHE HTTP_REWRITE HTTP_SSL HTTP_STATUS WWW
 
 DEBUGLOG_DESC=			Enable debug log (--with-debug)
@@ -111,6 +123,7 @@
 GOOGLE_PERFTOOLS_DESC=		Enable google perftools module
 HTTP_DESC=			Enable HTTP module
 HTTP_ADDITION_DESC=		Enable http_addition 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_FLV_DESC=			Enable http_flv module
@@ -134,21 +147,25 @@
 MAIL_SMTP_DESC=			Enable SMTP proxy module
 MAIL_SSL_DESC=			Enable mail_ssl module
 SPDY_DESC=			Enable SPDY protocol support (SSL req.)
+THREADS_DESC=			Enable threads support
 WWW_DESC=			Enable html sample files
+AJP_DESC=			3rd party ajp module
 CACHE_PURGE_DESC=		3rd party cache_purge module
-CTPP2_DESC=			3rd party CT++ module
+CLOJURE_DESC=			3rd party clojure module
+CT_DESC=			3rd party cert_transparency module (SSL req.)
 ECHO_DESC=			3rd party echo module
 HEADERS_MORE_DESC=		3rd party headers_more module
 HTTP_ACCEPT_LANGUAGE_DESC=	3rd party accept_language module
 HTTP_ACCESSKEY_DESC=		3rd party http_accesskey 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=		3rd party http_auth_request module
 HTTP_DAV_EXT_DESC=		3rd party webdav_ext module
 HTTP_EVAL_DESC=			3rd party eval module
 HTTP_FANCYINDEX_DESC=		3rd party http_fancyindex module
 HTTP_FOOTER_DESC=		3rd party http_footer module
+HTTP_JSON_STATUS_DESC=		3rd party http_json_status module
 HTTP_MOGILEFS_DESC=		3rd party mogilefs module
 HTTP_MP4_H264_DESC=		3rd party mp4/h264 module
 HTTP_NOTICE_DESC=		3rd party notice module
@@ -157,13 +174,14 @@
 HTTP_REDIS_DESC=		3rd party http_redis module
 HTTP_RESPONSE_DESC=		3rd party http_response module
 HTTP_SUBS_FILTER_DESC=		3rd party subs filter 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_FAIR_DESC=	3rd party upstream fair module
-HTTP_UPSTREAM_HASH_DESC=	3rd party upstream hash module
 HTTP_UPSTREAM_STICKY_DESC=	3rd party upstream sticky module
 HTTP_ZIP_DESC=			3rd party http_zip module
 ARRAYVAR_DESC=			3rd party array_var module
+BROTLI_DESC=			3rd party brotli module
 DRIZZLE_DESC=			3rd party drizzlie module
 ENCRYPTSESSION_DESC=		3rd party encrypted_session module
 FORMINPUT_DESC=			3rd party form_input module
@@ -175,7 +193,7 @@
 MODSECURITY_DESC=		3rd party mod_security module
 NAXSI_DESC=			3rd party naxsi module
 PASSENGER_DESC=			3rd party passenger module
-POSTGRES_DESC=			3rd party postgresql 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
@@ -182,11 +200,11 @@
 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
+SMALL_LIGHT_DESC=		3rd party small_light module
 SRCACHE_DESC=			3rd party srcache module
-SUPERVISORD_DESC=		3rd party supervisord module
-SYSLOG_SUPPORT_DESC=		3rd party syslog support
-TCP_PROXY_DESC=			3rd party tcp_proxy module
+STATSD_DESC=			3rd party statsd module
 UDPLOG_DESC=			3rd party udplog (syslog) module
 XRID_HEADER_DESC=		3rd party x-rid header module
 XSS_DESC=			3rd party xss module
@@ -252,7 +270,7 @@
 .endif
 
 .if ${PORT_OPTIONS:MGOOGLE_PERFTOOLS}
-LIB_DEPENDS+=	profiler:${PORTSDIR}/devel/google-perftools
+LIB_DEPENDS+=	libprofiler.so:${PORTSDIR}/devel/google-perftools
 CONFIGURE_ARGS+=--with-google_perftools_module
 .endif
 
@@ -266,15 +284,15 @@
 
 .if ${PORT_OPTIONS:MHTTP_ACCEPT_LANGUAGE}
 GIT_ACCEPT_LANGUAGE_VERSION=	2f69842
-MASTER_SITES+=	https://github.com/giom/nginx_accept_language_module/tarball/master/:accept_language
-DISTFILES+=	giom-nginx_accept_language_module-${GIT_ACCEPT_LANGUAGE_VERSION}.tar.gz:accept_language
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/giom-nginx_accept_language_module-${GIT_ACCEPT_LANGUAGE_VERSION}
+GH_ACCOUNT+=	giom:accept_language
+GH_PROJECT+=	nginx_accept_language_module:accept_language
+GH_TAGNAME+=	${GIT_ACCEPT_LANGUAGE_VERSION}:accept_language
+CONFIGURE_ARGS+=--add-module=${WRKSRC_accept_language}
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_ACCESSKEY}
 NGINX_ACCESSKEY_VERSION=	2.0.3
-MASTER_SITES+=	${MASTER_SITE_LOCAL:S/$/:accesskey/}
-MASTER_SITE_SUBDIR+=	osa/:accesskey
+MASTER_SITES+=	LOCAL/osa:accesskey
 DISTFILES+=	nginx-accesskey-${NGINX_ACCESSKEY_VERSION}.tar.gz:accesskey
 CONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx-accesskey-${NGINX_ACCESSKEY_VERSION}
 .endif
@@ -285,17 +303,31 @@
 
 .if ${PORT_OPTIONS:MHTTP_AUTH_DIGEST}
 GIT_AUTH_DIGEST_VERSION=	bd1c86a
-MASTER_SITES+=	https://github.com/samizdatco/nginx-http-auth-digest/tarball/master/:auth_digest
-DISTFILES+=	samizdatco-nginx-http-auth-digest-${GIT_AUTH_DIGEST_VERSION}.tar.gz:auth_digest
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/samizdatco-nginx-http-auth-digest-${GIT_AUTH_DIGEST_VERSION}
+GH_ACCOUNT+=	samizdatco:auth_digest
+GH_PROJECT+=	nginx-http-auth-digest:auth_digest
+GH_TAGNAME+=	${GIT_AUTH_DIGEST_VERSION}:auth_digest
+CONFIGURE_ARGS+=--add-module=${WRKSRC_auth_digest}
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_http_auth_digest_module.c
 .endif
 
+.if ${PORT_OPTIONS:MHTTP_AUTH_KRB5}
+GIT_HTTP_AUTH_KRB5_VERSION=	c85a38c
+GH_ACCOUNT+=	stnoonan:auth_krb5
+GH_PROJECT+=	spnego-http-auth-nginx-module:auth_krb5
+GH_TAGNAME+=	${GIT_HTTP_AUTH_KRB5_VERSION}:auth_krb5
+CONFIGURE_ARGS+=--add-module=${WRKSRC_auth_krb5}
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-spnego-http-auth-nginx-module-config
+# TODO: Provide optional dependence on Kerberos implementations from ports
+USES+=	gssapi:base,flags
+.endif
+
 .if ${PORT_OPTIONS:MHTTP_AUTH_LDAP}
 # WWW: https://github.com/kvspb/nginx-auth-ldap
-GIT_HTTP_AUTH_LDAP_VERSION=	c4dc7c9153
-MASTER_SITES+=	LOCAL/rm:http_auth_ldap
-DISTFILES+=	http_auth_ldap-${GIT_HTTP_AUTH_LDAP_VERSION}.tar.gz:http_auth_ldap
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/http_auth_ldap-${GIT_HTTP_AUTH_LDAP_VERSION}
+GIT_HTTP_AUTH_LDAP_VERSION=	8517bb0
+GH_ACCOUNT+=	kvspb:http_auth_ldap
+GH_PROJECT+=	nginx-auth-ldap:http_auth_ldap
+GH_TAGNAME+=	${GIT_HTTP_AUTH_LDAP_VERSION}:http_auth_ldap
+CONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx-auth-ldap-${GIT_HTTP_AUTH_LDAP_VERSION}
 USE_OPENLDAP=	yes
 .endif
 
@@ -307,10 +339,7 @@
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_AUTH_REQ}
-NGINX_AUTH_REQ_VERSION=	0.2
-MASTER_SITES+=	http://mdounin.ru/files/:auth_request
-DISTFILES+=	ngx_http_auth_request_module-${NGINX_AUTH_REQ_VERSION}.tar.gz:auth_request
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_http_auth_request_module-${NGINX_AUTH_REQ_VERSION}
+CONFIGURE_ARGS+=--with-http_auth_request_module
 .endif
 
 .if empty(PORT_OPTIONS:MHTTP_CACHE)
@@ -317,36 +346,61 @@
 CONFIGURE_ARGS+=--without-http-cache
 .endif
 
+.if ${PORT_OPTIONS:MAJP}
+NGINX_AJP_VERSION=	bf6cd93
+GH_ACCOUNT+=	yaoweibin:ajp
+GH_PROJECT+=	nginx_ajp_module:ajp
+GH_TAGNAME+=	${NGINX_AJP_VERSION}:ajp
+CONFIGURE_ARGS+=--add-module=${WRKSRC_ajp}
+.endif
+
 .if ${PORT_OPTIONS:MCACHE_PURGE}
-NGINX_CACHE_PURGE_VERSION=	2.1
+NGINX_CACHE_PURGE_VERSION=	2.3
 MASTER_SITES+=	http://labs.frickle.com/files/:cache_purge
 DISTFILES+=	ngx_cache_purge-${NGINX_CACHE_PURGE_VERSION}.tar.gz:cache_purge
 CONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_cache_purge-${NGINX_CACHE_PURGE_VERSION}
 .endif
 
-.if ${PORT_OPTIONS:MCTPP2}
-IGNORE=	CTPP2: update require
-LIB_DEPENDS+=	libctpp2.so:${PORTSDIR}/textproc/ctpp2
-NGINX_CTPP2_VERSION=	0.5
-MASTER_SITES+=	http://dl.vbart.ru/ngx-ctpp/:ctpp2
-DISTFILES+=	ngx_ctpp2-${NGINX_CTPP2_VERSION}.tar.gz:ctpp2
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_ctpp2-${NGINX_CTPP2_VERSION}
+.if ${PORT_OPTIONS:MCLOJURE}
+USE_JAVA=	yes
+JAVA_OS=	native
+JAVA_VERSION=	1.8
+JAVA_VENDOR=	openjdk
+JAVA_BUILD=	yes
+JAVA_RUN=	yes
+NGINX_CLOJURE_VERSION=	0.4.3
+GH_ACCOUNT+=	nginx-clojure:clojure
+GH_PROJECT+=	nginx-clojure:clojure
+GH_TAGNAME+=	v${NGINX_CLOJURE_VERSION}:clojure
+CONFIGURE_ENV+=	"JNI_INCS=-I${LOCALBASE}/openjdk8/include -I${LOCALBASE}/openjdk8/include/freebsd"
+CONFIGURE_ARGS+=--add-module=${WRKSRC_clojure}/src/c
 .endif
 
+.if ${PORT_OPTIONS:MCT}
+GIT_CT_VERSION=	f3cad5e
+GH_ACCOUNT+=	grahamedgecombe:ct
+GH_PROJECT+=	nginx-ct:ct
+GH_TAGNAME+=	${GIT_CT_VERSION}:ct
+CONFIGURE_ARGS+=--add-module=${WRKSRC_ct}
+NGINX_OPENSSL=	yes
+USE_HTTP_SSL=	yes
+WITH_OPENSSL_PORT=	yes
+.endif
+
 .if ${PORT_OPTIONS:MECHO}
-NGINX_ECHO_VERSION=	0.51
-GIT_ECHO_VERSION=	0-g44c92a5
-MASTER_SITES+=	https://github.com/openresty/echo-nginx-module/tarball/v${NGINX_ECHO_VERSION}/:echo
-DISTFILES+=	openresty-echo-nginx-module-v${NGINX_ECHO_VERSION}-${GIT_ECHO_VERSION}.tar.gz:echo
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-echo-nginx-module-${GIT_ECHO_VERSION:S/^0-g//}
+NGINX_ECHO_VERSION=	4f7aa50
+GH_ACCOUNT+=	openresty:echo
+GH_PROJECT+=	echo-nginx-module:echo
+GH_TAGNAME+=	${NGINX_ECHO_VERSION}:echo
+CONFIGURE_ARGS+=--add-module=${WRKSRC_echo}
 .endif
 
 .if ${PORT_OPTIONS:MHEADERS_MORE}
-NGINX_HEADERS_MORE_VERSION=	0.25
-GIT_HEADERS_MORE_VERSION=	0-g0c6e05d
-MASTER_SITES+=	https://github.com/openresty/headers-more-nginx-module/tarball/v${NGINX_HEADERS_MORE_VERSION}/:headers_more
-DISTFILES+=	openresty-headers-more-nginx-module-v${NGINX_HEADERS_MORE_VERSION}-${GIT_HEADERS_MORE_VERSION}.tar.gz:headers_more
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-headers-more-nginx-module-${GIT_HEADERS_MORE_VERSION:S/^0-g//}
+NGINX_HEADERS_MORE_VERSION=	f5559ec
+GH_ACCOUNT+=	openresty:headers_more
+GH_PROJECT+=	headers-more-nginx-module:headers_more
+GH_TAGNAME+=	${NGINX_HEADERS_MORE_VERSION}:headers_more
+CONFIGURE_ARGS+=--add-module=${WRKSRC_headers_more}
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_DAV} || defined(USE_HTTP_DAV)
@@ -356,35 +410,35 @@
 .if ${PORT_OPTIONS:MHTTP_DAV_EXT}
 USE_HTTP_DAV=	yes
 LIB_DEPENDS+=	libexpat.so:${PORTSDIR}/textproc/expat2
-NGINX_DAV_EXT_VERSION=	0.0.2
-GIT_DAV_EXT_VERSION=	0-g0e07a3e
-MASTER_SITES+=	https://github.com/arut/nginx-dav-ext-module/tarball/v${NGINX_DAV_EXT_VERSION}/:dav_ext
-DISTFILES+=	arut-nginx-dav-ext-module-v${NGINX_DAV_EXT_VERSION}-${GIT_DAV_EXT_VERSION}.tar.gz:dav_ext
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/arut-nginx-dav-ext-module-${GIT_DAV_EXT_VERSION:S/^0-g//}
+NGINX_DAV_EXT_VERSION=	0.0.3
+GH_ACCOUNT+=	arut:dav_ext
+GH_PROJECT+=	nginx-dav-ext-module:dav_ext
+GH_TAGNAME+=	v${NGINX_DAV_EXT_VERSION}:dav_ext
+CONFIGURE_ARGS+=--add-module=${WRKSRC_dav_ext}
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_EVAL}
-NGINX_EVAL_VERSION=	1.0.3
-GIT_EVAL_VERSION=	0-g125fa2e
-MASTER_SITES+=	https://github.com/vkholodkov/nginx-eval-module/tarball/${NGINX_EVAL_VERSION}/:eval
-DISTFILES+=	vkholodkov-nginx-eval-module-${NGINX_EVAL_VERSION}-${GIT_EVAL_VERSION}.tar.gz:eval
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/vkholodkov-nginx-eval-module-${GIT_EVAL_VERSION:S/^0-g//}
+NGINX_EVAL_VERSION=	342c812
+GH_ACCOUNT+=	openresty:eval
+GH_PROJECT+=	nginx-eval-module:eval
+GH_TAGNAME+=	${NGINX_EVAL_VERSION}:eval
+CONFIGURE_ARGS+=--add-module=${WRKSRC_eval}
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_FANCYINDEX}
-NGINX_FANCYINDEX_VERSION=	0.3.1
-MASTER_SITES+=	${MASTER_SITE_LOCAL:S/$/:fancyindex/}
-MASTER_SITE_SUBDIR+=	osa/:fancyindex
-DISTFILES+=	ngx-fancyindex-${NGINX_FANCYINDEX_VERSION}.tar.gz:fancyindex
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx-fancyindex-${NGINX_FANCYINDEX_VERSION}
+NGINX_FANCYINDEX_VERSION=	0.3.6
+GH_ACCOUNT+=	aperezdc:fancyindex
+GH_PROJECT+=	ngx-fancyindex:fancyindex
+GH_TAGNAME+=	v${NGINX_FANCYINDEX_VERSION}:fancyindex
+CONFIGURE_ARGS+=--add-module=${WRKSRC_fancyindex}
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_FOOTER}
 NGINX_FOOTER_VERSION=	1.2.2
-GIT_FOOTER_VERSION=	0-g3572184
-MASTER_SITES+=	https://github.com/alibaba/nginx-http-footer-filter/tarball/${NGINX_FOOTER_VERSION}/:footer
-DISTFILES+=	alibaba-nginx-footer-filter-${NGINX_FOOTER_VERSION}-${GIT_FOOTER_VERSION}.tar.gz:footer
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/alibaba-nginx-http-footer-filter-${GIT_FOOTER_VERSION:S/^0-g//}
+GH_ACCOUNT+=	alibaba:footer
+GH_PROJECT+=	nginx-http-footer-filter:footer
+GH_TAGNAME+=	${NGINX_FOOTER_VERSION}:footer
+CONFIGURE_ARGS+=--add-module=${WRKSRC_footer}
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_FLV}
@@ -391,6 +445,14 @@
 CONFIGURE_ARGS+=--with-http_flv_module
 .endif
 
+.if ${PORT_OPTIONS:MHTTP_JSON_STATUS}
+NGINX_JSON_STATUS_VERSION= 1d2f303 
+GH_ACCOUNT+=	nginx-modules:json_status
+GH_PROJECT+=	ngx_http_json_status_module:json_status
+GH_TAGNAME+=	${NGINX_JSON_STATUS_VERSION}:json_status
+CONFIGURE_ARGS+=--add-module=${WRKSRC_json_status}
+.endif
+
 .if ${PORT_OPTIONS:MHTTP_GEOIP}
 CONFIGURE_ARGS+=--with-http_geoip_module
 LIB_DEPENDS+=	libGeoIP.so:${PORTSDIR}/net/GeoIP
@@ -418,6 +480,7 @@
 MASTER_SITES+=	http://www.grid.net.ru/nginx/download/:mogilefs
 DISTFILES+=	nginx_mogilefs_module-${NGINX_MOGILEFS_VERSION}.tar.gz:mogilefs
 CONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx_mogilefs_module-${NGINX_MOGILEFS_VERSION}
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_http_mogilefs_module.c
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_MP4_H264}
@@ -429,10 +492,11 @@
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_NOTICE}
-GIT_NOTICE_VERSION=	0-g3c95966
-MASTER_SITES+=	https://github.com/kr/nginx-notice/tarball/master/:notice
-DISTFILES+=	kr-nginx-notice-${GIT_NOTICE_VERSION}.tar.gz:notice
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/kr-nginx-notice-${GIT_NOTICE_VERSION:S/^0-g//}
+GIT_NOTICE_VERSION=	3c95966
+GH_ACCOUNT+=	kr:notice
+GH_PROJECT+=	nginx-notice:notice
+GH_TAGNAME+=	${GIT_NOTICE_VERSION}:notice
+CONFIGURE_ARGS+=--add-module=${WRKSRC_notice}
 EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_http_notice_module.c
 .endif
 
@@ -439,22 +503,23 @@
 .if ${PORT_OPTIONS:MHTTP_PERL}
 CATEGORIES+=	perl5
 CONFIGURE_ARGS+=--with-http_perl_module
-USE_PERL5=	yes
+USES+=		perl5
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_PUSH}
-NGINX_PUSH_VERSION=	0.692
-MASTER_SITES+=	http://pushmodule.slact.net/downloads/:push
-DISTFILES+=	nginx_http_push_module-${NGINX_PUSH_VERSION}.tar.gz:push
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx_http_push_module-${NGINX_PUSH_VERSION}
+GIT_PUSH_VERSION=	0.99.5
+GH_ACCOUNT+=	slact:push
+GH_PROJECT+=	nchan:push
+GH_TAGNAME+=	v${GIT_PUSH_VERSION}:push
+CONFIGURE_ARGS+=--add-module=${WRKSRC_push}
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_PUSH_STREAM}
-NGINX_PUSH_STREAM_VERSION=	0.3.5
-GIT_PUSH_STREAM_VERSION=	0-gb6a8c46
-MASTER_SITES+=	https://github.com/wandenberg/nginx-push-stream-module/tarball/${NGINX_PUSH_STREAM_VERSION}/:pushstream
-DISTFILES+=	wandenberg-nginx-push-stream-module-${NGINX_PUSH_STREAM_VERSION}-${GIT_PUSH_STREAM_VERSION}.tar.gz:pushstream
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/wandenberg-nginx-push-stream-module-${GIT_PUSH_STREAM_VERSION:S/^0-g//}
+NGINX_PUSH_STREAM_VERSION=	0.5.1
+GH_ACCOUNT+=	wandenberg:pushstream
+GH_PROJECT+=	nginx-push-stream-module:pushstream
+GH_TAGNAME+=	${NGINX_PUSH_STREAM_VERSION}:pushstream
+CONFIGURE_ARGS+=--add-module=${WRKSRC_pushstream}
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_RANDOM_INDEX}
@@ -466,9 +531,8 @@
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_REDIS}
-NGINX_REDIS_VERSION=	0.3.7
-MASTER_SITES+=	${MASTER_SITE_LOCAL:S/$/:redis/}
-MASTER_SITE_SUBDIR+=	osa/:redis
+NGINX_REDIS_VERSION=	0.3.8
+MASTER_SITES+=	LOCAL/osa:redis
 DISTFILES+=	ngx_http_redis-${NGINX_REDIS_VERSION}.tar.gz:redis
 CONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_http_redis-${NGINX_REDIS_VERSION}
 .endif
@@ -481,13 +545,24 @@
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_SUBS_FILTER}
-NGINX_HTTP_SUBS_FILTER_VERSION=	0.6.2
-GIT_HTTP_SUBS_FILTER_VERSION=	0-g27a01b3
-MASTER_SITES+=	https://github.com/yaoweibin/ngx_http_substitutions_filter_module/tarball/${NGINX_HTTP_SUBS_FILTER_VERSION}/:subs_filter
-DISTFILES+=	yaoweibin-ngx_http_substitutions_filter_module-${NGINX_HTTP_SUBS_FILTER_VERSION}-${GIT_HTTP_SUBS_FILTER_VERSION}.tar.gz:subs_filter
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/yaoweibin-ngx_http_substitutions_filter_module-${GIT_HTTP_SUBS_FILTER_VERSION:S/^0-g//}
+NGINX_HTTP_SUBS_FILTER_VERSION=	0.6.4
+GH_ACCOUNT+=	yaoweibin:subs_filter
+GH_PROJECT+=	ngx_http_substitutions_filter_module:subs_filter
+GH_TAGNAME+=	v${NGINX_HTTP_SUBS_FILTER_VERSION}:subs_filter
+CONFIGURE_ARGS+=--add-module=${WRKSRC_subs_filter}
 .endif
 
+.if ${PORT_OPTIONS:MHTTP_TARANTOOL}
+LIB_DEPENDS+=	libmsgpuck.so:${PORTSDIR}/devel/msgpuck \
+		libyajl.so:${PORTSDIR}/devel/yajl
+GH_ACCOUNT+=	tarantool:nginx_tarantool
+GH_PROJECT+=	nginx_upstream_module:nginx_tarantool
+GH_TAGNAME+=	966f2f5:nginx_tarantool
+CFLAGS+=	-I${LOCALBASE}/include/msgpuck
+CONFIGURE_ARGS+=--add-module=${WRKSRC_nginx_tarantool}
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_http_tarantool-config
+.endif
+
 .if ${PORT_OPTIONS:MHTTP_SECURE_LINK}
 CONFIGURE_ARGS+=--with-http_secure_link_module
 .endif
@@ -501,37 +576,28 @@
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_UPLOAD}
-NGINX_UPLOAD_VERSION=	2.2.0
-MASTER_SITES+=	http://www.grid.net.ru/nginx/download/:upload
-DISTFILES+=	nginx_upload_module-${NGINX_UPLOAD_VERSION}.tar.gz:upload
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx_upload_module-${NGINX_UPLOAD_VERSION}
-EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_http_upload_module.c
+GIT_UPLOAD_VERSION= aba1e3f34c
+GH_ACCOUNT+=	vkholodkov:upload
+GH_PROJECT+=	nginx-upload-module:upload
+GH_TAGNAME+=	${GIT_UPLOAD_VERSION}:upload
+CONFIGURE_ARGS+=--add-module=${WRKSRC_upload}
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_UPLOAD_PROGRESS}
 NGINX_UPLOADPROGRESS_VERSION=	0.9.0
-GIT_UPLOADPROGRESS_VERSION=	0-ga788dea
-MASTER_SITES+=	https://github.com/masterzen/nginx-upload-progress-module/tarball/v${NGINX_UPLOADPROGRESS_VERSION}/:uploadprogress
-DISTFILES+=	masterzen-nginx-upload-progress-module-v${NGINX_UPLOADPROGRESS_VERSION}-${GIT_UPLOADPROGRESS_VERSION}.tar.gz:uploadprogress
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/masterzen-nginx-upload-progress-module-${GIT_UPLOADPROGRESS_VERSION:S/^0-g//}
+GH_ACCOUNT+=	masterzen:uploadprogress
+GH_PROJECT+=	nginx-upload-progress-module:uploadprogress
+GH_TAGNAME+=	v${NGINX_UPLOADPROGRESS_VERSION}:uploadprogress
+CONFIGURE_ARGS+=--add-module=${WRKSRC_uploadprogress}
 .endif
 
-.if !empty(PORT_OPTIONS:MHTTP_UPSTREAM_FAIR) || !empty(PORT_OPTIONS:MSUPERVISORD)
+.if !empty(PORT_OPTIONS:MHTTP_UPSTREAM_FAIR)
 NGINX_UPSTREAM_FAIR_VERSION=	20090923
-MASTER_SITES+=	${MASTER_SITE_LOCAL:S/$/:upstreamfair/}
-MASTER_SITE_SUBDIR+=	osa/:upstreamfair
+MASTER_SITES+=	LOCAL/osa:upstreamfair
 DISTFILES+=	nginx_upstream_fair-${NGINX_UPSTREAM_FAIR_VERSION}.tar.gz:upstreamfair
 CONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx_upstream_fair-${NGINX_UPSTREAM_FAIR_VERSION}
 .endif
 
-.if ${PORT_OPTIONS:MHTTP_UPSTREAM_HASH}
-NGINX_UPSTREAM_HASH_VERSION=	0.3.1
-MASTER_SITES+=	http://wiki.nginx.org/images/1/11/:upstreamhash
-DISTFILES+=	Nginx_upstream_hash-${NGINX_UPSTREAM_HASH_VERSION}.tar.gz:upstreamhash
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx_upstream_hash-${NGINX_UPSTREAM_HASH_VERSION}
-EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_http_upstream.h
-.endif
-
 .if ${PORT_OPTIONS:MHTTP_UPSTREAM_STICKY}
 USE_HTTP_SSL=	yes
 NGINX_UPSTREAM_STICKY_VERSION=	1.2.4
@@ -541,7 +607,7 @@
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_XSLT}
-USE_GNOME=	libxml2 libxslt
+USE_GNOME+=	libxml2 libxslt
 CONFIGURE_ARGS+=--with-http_xslt_module
 .endif
 
@@ -554,48 +620,45 @@
 
 .if ${PORT_OPTIONS:MDRIZZLE}
 LIB_DEPENDS+=	libdrizzle.so:${PORTSDIR}/databases/libdrizzle
-NGINX_DRIZZLE_VERSION=	0.1.7
-GIT_DRIZZLE_VERSION=	0-gb83a8a9
-MASTER_SITES+=	https://github.com/chaoslawful/drizzle-nginx-module/tarball/v${NGINX_DRIZZLE_VERSION}/:drizzle
-DISTFILES+=	chaoslawful-drizzle-nginx-module-v${NGINX_DRIZZLE_VERSION}-${GIT_DRIZZLE_VERSION}.tar.gz:drizzle
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/chaoslawful-drizzle-nginx-module-${GIT_DRIZZLE_VERSION:S/^0-g//}
-EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-chaoslawful-drizzle-nginx-module-config
+NGINX_DRIZZLE_VERSION=	0.1.9
+GH_ACCOUNT+=	openresty:drizzle
+GH_PROJECT+=	drizzle-nginx-module:drizzle
+GH_TAGNAME+=	v${NGINX_DRIZZLE_VERSION}:drizzle
+CONFIGURE_ARGS+=--add-module=${WRKSRC_drizzle}
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-openresty-drizzle-nginx-module-config
 .endif
 
 .if ${PORT_OPTIONS:MARRAYVAR} || ${PORT_OPTIONS:MENCRYPTSESSION} || ${PORT_OPTIONS:MFORMINPUT} || ${PORT_OPTIONS:MICONV} || ${PORT_OPTIONS:MLUA} || ${PORT_OPTIONS:MSET_MISC}
 NGINX_DEVEL_KIT_VERSION=	0.2.19
-GIT_DEVEL_KIT_VERSION=	0-g8dd0df5
-MASTER_SITES+=	https://github.com/simpl/ngx_devel_kit/tarball/v${NGINX_DEVEL_KIT_VERSION}/:devel_kit
-DISTFILES+=	simpl-ngx_devel_kit-v${NGINX_DEVEL_KIT_VERSION}-${GIT_DEVEL_KIT_VERSION}.tar.gz:devel_kit
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/simpl-ngx_devel_kit-${GIT_DEVEL_KIT_VERSION:S/^0-g//}
+GH_ACCOUNT+=	simpl:devel_kit
+GH_PROJECT+=	ngx_devel_kit:devel_kit
+GH_TAGNAME+=	v${NGINX_DEVEL_KIT_VERSION}:devel_kit
+CONFIGURE_ARGS+=--add-module=${WRKSRC_devel_kit}
 .endif
 
 .if ${PORT_OPTIONS:MENCRYPTSESSION}
 NGINX_ENCRYPTSESSION_VERSION=	0.03
-GIT_ENCRYPTSESSION_VERSION=	0-g49d741b
-MASTER_SITES+=	https://github.com/openresty/encrypted-session-nginx-module/tarball/v${NGINX_ENCRYPTSESSION_VERSION}/:encryptsession
-DISTFILES+=	openresty-encrypted-session-nginx-module-v${NGINX_ENCRYPTSESSION_VERSION}-${GIT_ENCRYPTSESSION_VERSION}.tar.gz:encryptsession
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-encrypted-session-nginx-module-${GIT_ENCRYPTSESSION_VERSION:S/^0-g//}
+GH_ACCOUNT+=	openresty:encryptsession
+GH_PROJECT+=	encrypted-session-nginx-module:encryptsession
+GH_TAGNAME+=	v${NGINX_ENCRYPTSESSION_VERSION}:encryptsession
+CONFIGURE_ARGS+=--add-module=${WRKSRC_encryptsession}
 .endif
 
 .if ${PORT_OPTIONS:MGRIDFS}
 NGINX_GRIDFS_VERSION=	0.8
-GIT_GRIDFS_VERSION=	0-gb5f8113
 MONGO_C_DRIVER_VERSION=		0.3.1
-GIT_MONGO_C_DRIVER_VERSION=	0-g9b4b232
-MASTER_SITES+=	https://github.com/mdirolf/nginx-gridfs/tarball/v${NGINX_GRIDFS_VERSION}/:gridfs
-MASTER_SITES+=	https://github.com/mongodb/mongo-c-driver/tarball/v${MONGO_C_DRIVER_VERSION}/:mongo_c
-DISTFILES+=	mdirolf-nginx-gridfs-v${NGINX_GRIDFS_VERSION}-${GIT_GRIDFS_VERSION}.tar.gz:gridfs
-DISTFILES+=	mongodb-mongo-c-driver-v${MONGO_C_DRIVER_VERSION}-${GIT_MONGO_C_DRIVER_VERSION}.tar.gz:mongo_c
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/mdirolf-nginx-gridfs-${GIT_GRIDFS_VERSION:S/^0-g//}
+GH_ACCOUNT+=	mdirolf:gridfs mongodb:mongo_c
+GH_PROJECT+=	nginx-gridfs:gridfs mongo-c-driver:mongo_c
+GH_TAGNAME+=	v${NGINX_GRIDFS_VERSION}:gridfs v${MONGO_C_DRIVER_VERSION}:mongo_c
+CONFIGURE_ARGS+=--add-module=${WRKSRC_gridfs}
 .endif
 
 .if ${PORT_OPTIONS:MLET}
 NGINX_LET_VERSION=	0.0.4
-GIT_LET_VERSION=	0-ga5e1dc5
-MASTER_SITES+=	https://github.com/arut/nginx-let-module/tarball/v${NGINX_LET_VERSION}/:let
-DISTFILES+=	arut-nginx-let-module-v${NGINX_LET_VERSION}-${GIT_LET_VERSION}.tar.gz:let
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/arut-nginx-let-module-${GIT_LET_VERSION:S/^0-g//}
+GH_ACCOUNT+=	arut:let
+GH_PROJECT+=	nginx-let-module:let
+GH_TAGNAME+=	v${NGINX_LET_VERSION}:let
+CONFIGURE_ARGS+=--add-module=${WRKSRC_let}
 .endif
 
 .if ${PORT_OPTIONS:MLUA}
@@ -602,38 +665,42 @@
 LIB_DEPENDS+=	libluajit-5.1.so:${PORTSDIR}/lang/luajit
 CONFIGURE_ENV+=	"LUAJIT_INC=${LOCALBASE}/include/luajit-2.0"
 CONFIGURE_ENV+=	"LUAJIT_LIB=${LOCALBASE}/lib"
-NGINX_LUA_VERSION=	0.9.4
-GIT_LUA_VERSION=	0-g6169a19
-MASTER_SITES+=	https://github.com/openresty/lua-nginx-module/tarball/v${NGINX_LUA_VERSION}/:lua
-DISTFILES+=	openresty-lua-nginx-module-v${NGINX_LUA_VERSION}-${GIT_LUA_VERSION}.tar.gz:lua
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-lua-nginx-module-${GIT_LUA_VERSION:S/^0-g//}
+NGINX_LUA_VERSION=	7410339
+GH_ACCOUNT+=	openresty:lua
+GH_PROJECT+=	lua-nginx-module:lua
+GH_TAGNAME+=	${NGINX_LUA_VERSION}:lua
+CONFIGURE_ARGS+=--add-module=${WRKSRC_lua}
 .endif
 
 .if ${PORT_OPTIONS:MMEMC}
-NGINX_MEMC_VERSION=	0.14
-GIT_MEMC_VERSION=	0-gde4cf86
-MASTER_SITES+=	https://github.com/openresty/memc-nginx-module/tarball/v${NGINX_MEMC_VERSION}/:memc
-DISTFILES+=	openresty-memc-nginx-module-v${NGINX_MEMC_VERSION}-${GIT_MEMC_VERSION}.tar.gz:memc
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-memc-nginx-module-${GIT_MEMC_VERSION:S/^0-g//}
+NGINX_MEMC_VERSION=	0.16
+GH_ACCOUNT+=	openresty:memc
+GH_PROJECT+=	memc-nginx-module:memc
+GH_TAGNAME+=	v${NGINX_MEMC_VERSION}:memc
+CONFIGURE_ARGS+=--add-module=${WRKSRC_memc}
 .endif
 
 .if ${PORT_OPTIONS:MMODSECURITY}
-NGINX_MODSECURITY_VERSION=	2.7.5
-LIB_DEPENDS+=	libpcre.so:${PORTSDIR}/devel/pcre \
-		libapr-1.so:${PORTSDIR}/devel/apr1
+NGINX_MODSECURITY_VERSION=	2.9.1-RC1
+LIB_DEPENDS+=	libapr-1.so:${PORTSDIR}/devel/apr1 \
+		libcurl.so:${PORTSDIR}/ftp/curl \
+		libluajit-5.1.so:${PORTSDIR}/lang/luajit \
+		libpcre.so:${PORTSDIR}/devel/pcre \
+		libyajl.so:${PORTSDIR}/devel/yajl
 USE_APACHE=	22+
-USE_GNOME=	libxml2
-MASTER_SITES+=	http://www.modsecurity.org/tarball/${NGINX_MODSECURITY_VERSION}/:modsecurity
-DISTFILES+=	modsecurity-apache_${NGINX_MODSECURITY_VERSION}.tar.gz:modsecurity
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/modsecurity-apache_${NGINX_MODSECURITY_VERSION}/nginx/modsecurity
-EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-nginx-modsecurity-config
+USE_GNOME+=	libxml2
+MASTER_SITES+=	http://www.modsecurity.org/tarball/${NGINX_MODSECURITY_VERSION:S/RC/rc/}/:modsecurity
+DISTFILES+=	modsecurity-${NGINX_MODSECURITY_VERSION}.tar.gz:modsecurity
+CONFIGURE_ARGS+=--add-module=${WRKDIR}/modsecurity-${NGINX_MODSECURITY_VERSION}/nginx/modsecurity
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-nginx-modsecurity-configure
 .endif
 
 .if ${PORT_OPTIONS:MNAXSI}
-NGINX_NAXSI_VERSION=	0.50
-MASTER_SITES+=	http://naxsi.googlecode.com/files/:naxsi
-DISTFILES+=	naxsi-core-${NGINX_NAXSI_VERSION}.tgz:naxsi
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/naxsi-core-${NGINX_NAXSI_VERSION}/naxsi_src
+NGINX_NAXSI_VERSION=	0.54
+GH_ACCOUNT+=	nbs-system:naxsi
+GH_PROJECT+=	naxsi:naxsi
+GH_TAGNAME+=	${NGINX_NAXSI_VERSION}:naxsi
+CONFIGURE_ARGS+=--add-module=${WRKDIR}/naxsi-${NGINX_NAXSI_VERSION}/naxsi_src
 .endif
 
 .if ${PORT_OPTIONS:MHTTP_REWRITE} || defined(USE_HTTP_REWRITE)
@@ -646,10 +713,10 @@
 .endif
 
 .if ${PORT_OPTIONS:MPASSENGER}
-PASSENGER_VERSION=	4.0.45
+PASSENGER_VERSION=	5.0.26
 MASTER_SITES+=	http://s3.amazonaws.com/phusion-passenger/releases/:passenger
 DISTFILES+=	passenger-${PASSENGER_VERSION}.tar.gz:passenger
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/passenger-${PASSENGER_VERSION}/ext/nginx
+CONFIGURE_ARGS+=--add-module=${WRKDIR}/passenger-${PASSENGER_VERSION}/src/nginx_module
 EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-passenger-build-nginx.rb
 .if empty(PORT_OPTIONS:MDEBUG)
 CONFIGURE_ENV+=	OPTIMIZE="yes"
@@ -658,53 +725,53 @@
 .endif
 
 .if ${PORT_OPTIONS:MPOSTGRES}
-IGNORE=	POSTGRES: update require
-USE_PGSQL=	yes
-NGINX_POSTGRES_VERSION=	0.9
-MASTER_SITES+=	http://labs.frickle.com/files/:postgres
-DISTFILES+=	ngx_postgres-${NGINX_POSTGRES_VERSION}.tar.gz:postgres
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_postgres-${NGINX_POSTGRES_VERSION}
+USES+=	pgsql
+NGINX_POSTGRES_VERSION=		1.0rc7
+GH_ACCOUNT+=	FRiCKLE:postgres
+GH_PROJECT+=	ngx_postgres:postgres
+GH_TAGNAME+=	${NGINX_POSTGRES_VERSION}:postgres
+CONFIGURE_ARGS+=--add-module=${WRKSRC_postgres}
 EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_postgres-config
 .endif
 
 .if ${PORT_OPTIONS:MRDS_CSV}
-NGINX_RDS_CSV_VERSION=	0.05
-GIT_RDS_CSV_VERSION=	0-g607e26b
-MASTER_SITES+=	https://github.com/openresty/rds-csv-nginx-module/tarball/v${NGINX_RDS_CSV_VERSION}/:rdscsv
-DISTFILES+=	openresty-rds-csv-nginx-module-v${NGINX_RDS_CSV_VERSION}-${GIT_RDS_CSV_VERSION}.tar.gz:rdscsv
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-rds-csv-nginx-module-${GIT_RDS_CSV_VERSION:S/^0-g//}
+NGINX_RDS_CSV_VERSION=	0.07
+GH_ACCOUNT+=	openresty:rdscsv
+GH_PROJECT+=	rds-csv-nginx-module:rdscsv
+GH_TAGNAME+=	v${NGINX_RDS_CSV_VERSION}:rdscsv
+CONFIGURE_ARGS+=--add-module=${WRKSRC_rdscsv}
 .endif
 
 .if ${PORT_OPTIONS:MRDS_JSON}
-NGINX_RDS_JSON_VERSION=	0.13
-GIT_RDS_JSON_VERSION=	0-g8292070
-MASTER_SITES+=	https://github.com/openresty/rds-json-nginx-module/tarball/v${NGINX_RDS_JSON_VERSION}/:rdsjson
-DISTFILES+=	openresty-rds-json-nginx-module-v${NGINX_RDS_JSON_VERSION}-${GIT_RDS_JSON_VERSION}.tar.gz:rdsjson
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-rds-json-nginx-module-${GIT_RDS_JSON_VERSION:S/^0-g//}
+NGINX_RDS_JSON_VERSION=	0.14
+GH_ACCOUNT+=	openresty:rdsjson
+GH_PROJECT+=	rds-json-nginx-module:rdsjson
+GH_TAGNAME+=	v${NGINX_RDS_JSON_VERSION}:rdsjson
+CONFIGURE_ARGS+=--add-module=${WRKSRC_rdsjson}
 .endif
 
 .if ${PORT_OPTIONS:MREDIS2}
-NGINX_REDIS2_VERSION=	0.10
-GIT_REDIS2_VERSION=	0-g78a7622
-MASTER_SITES+=	https://github.com/openresty/redis2-nginx-module/tarball/v${NGINX_REDIS2_VERSION}/:redis2
-DISTFILES+=	openresty-redis2-nginx-module-v${NGINX_REDIS2_VERSION}-${GIT_REDIS2_VERSION}.tar.gz:redis2
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-redis2-nginx-module-${GIT_REDIS2_VERSION:S/^0-g//}
+NGINX_REDIS2_VERSION=	0.12
+GH_ACCOUNT+=	openresty:redis2
+GH_PROJECT+=	redis2-nginx-module:redis2
+GH_TAGNAME+=	v${NGINX_REDIS2_VERSION}:redis2
+CONFIGURE_ARGS+=--add-module=${WRKSRC_redis2}
 .endif
 
 .if ${PORT_OPTIONS:MRTMP}
-NGINX_RTMP_VERSION=	1.1.4
-MASTER_SITES+=	https://github.com/arut/nginx-rtmp-module/archive/v${NGINX_RTMP_VERSION}/:rtmp
-DISTFILES+=	rtmp-nginx-module-v${NGINX_RTMP_VERSION}.tar.gz:rtmp
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx-rtmp-module-${NGINX_RTMP_VERSION}
+NGINX_RTMP_VERSION=	1.1.7
+GH_ACCOUNT+=	arut:rtmp
+GH_PROJECT+=	nginx-rtmp-module:rtmp
+GH_TAGNAME+=	v${NGINX_RTMP_VERSION}:rtmp
+CONFIGURE_ARGS+=--add-module=${WRKSRC_rtmp}
 .endif
 
 .if ${PORT_OPTIONS:MSET_MISC}
-NGINX_SET_MISC_VERSION=	0.24
-GIT_SET_MISC_VERSION=	0-g36fd035
-MASTER_SITES+=	https://github.com/openresty/set-misc-nginx-module/tarball/v${NGINX_SET_MISC_VERSION}/:setmisc
-DISTFILES+=	openresty-set-misc-nginx-module-v${NGINX_SET_MISC_VERSION}-${GIT_SET_MISC_VERSION}.tar.gz:setmisc
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-set-misc-nginx-module-${GIT_SET_MISC_VERSION:S/^0-g//}
-EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-openresty-set-misc-nginx-module-config
+NGINX_SET_MISC_VERSION=	6582fb4
+GH_ACCOUNT+=	openresty:setmisc
+GH_PROJECT+=	set-misc-nginx-module:setmisc
+GH_TAGNAME+=	${NGINX_SET_MISC_VERSION}:setmisc
+CONFIGURE_ARGS+=--add-module=${WRKSRC_setmisc}
 .endif
 
 .if ${PORT_OPTIONS:MSFLOW}
@@ -713,9 +780,18 @@
 DISTFILES+=	nginx-sflow-module-${NGINX_SFLOW_VERSION}.tar.gz:sflow
 CONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx-sflow-module-${NGINX_SFLOW_VERSION}
 EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_http_sflow_config.c \
-		${PATCHDIR}/extra-patch-ngx_http_sflow_config.h
+		${PATCHDIR}/extra-patch-ngx_http_sflow_config.h \
+		${PATCHDIR}/extra-patch-ngx_http_sflow_module.c
 .endif
 
+.if ${PORT_OPTIONS:MSHIBBOLETH}
+GIT_SHIBBOLETH_VERSION=	20150121
+GH_ACCOUNT+=	nginx-shib:shib
+GH_PROJECT+=	nginx-http-shibboleth:shib
+GH_TAGNAME+=	v${GIT_SHIBBOLETH_VERSION}:shib
+CONFIGURE_ARGS+=--add-module=${WRKSRC_shib}
+.endif
+
 .if ${PORT_OPTIONS:MSLOWFS_CACHE}
 NGINX_SLOWFS_CACHE_VERSION=	1.10
 MASTER_SITES+=	http://labs.frickle.com/files/:slowfs_cache
@@ -723,38 +799,33 @@
 CONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_slowfs_cache-${NGINX_SLOWFS_CACHE_VERSION}
 .endif
 
-.if ${PORT_OPTIONS:MSRCACHE}
-NGINX_SRCACHE_VERSION=	0.25
-GIT_SRCACHE_VERSION=	0-gf25fe90
-MASTER_SITES+=	https://github.com/openresty/srcache-nginx-module/tarball/v${NGINX_SRCACHE_VERSION}/:srcache
-DISTFILES+=	openresty-srcache-nginx-module-v${NGINX_SRCACHE_VERSION}-${GIT_SRCACHE_VERSION}.tar.gz:srcache
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-srcache-nginx-module-${GIT_SRCACHE_VERSION:S/^0-g//}
+.if ${PORT_OPTIONS:MSMALL_LIGHT}
+NGINX_SMALL_LIGHT_VERSION=	0.6.15
+LIB_DEPENDS+=	libMagickCore-6.so:${PORTSDIR}/graphics/ImageMagick \
+		libMagickWand-6.so:${PORTSDIR}/graphics/ImageMagick \
+		libpcre.so:${PORTSDIR}/devel/pcre
+GH_ACCOUNT+=	cubicdaiya:small_light
+GH_PROJECT+=	ngx_small_light:small_light
+GH_TAGNAME+=	v${NGINX_SMALL_LIGHT_VERSION}:small_light
+CONFIGURE_ARGS+=--add-module=${WRKSRC_small_light}
 .endif
 
-.if ${PORT_OPTIONS:MSUPERVISORD}
-NGINX_SUPERVISORD_VERSION=	1.4
-MASTER_SITES+=	http://labs.frickle.com/files/:supervisord
-DISTFILES+=	ngx_supervisord-${NGINX_SUPERVISORD_VERSION}.tar.gz:supervisord
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_supervisord-${NGINX_SUPERVISORD_VERSION}
+.if ${PORT_OPTIONS:MSRCACHE}
+NGINX_SRCACHE_VERSION=	0.30
+GH_ACCOUNT+=	openresty:srcache
+GH_PROJECT+=	srcache-nginx-module:srcache
+GH_TAGNAME+=	v${NGINX_SRCACHE_VERSION}:srcache
+CONFIGURE_ARGS+=--add-module=${WRKSRC_srcache}
 .endif
 
-.if ${PORT_OPTIONS:MSYSLOG_SUPPORT}
-#GIT_SYSLOG_PATCH_VERSION=3ca5ba65541637f74467038aa032e2586321d0cb
-GIT_SYSLOG_PATCH_VERSION=3ca5ba6
-MASTER_SITES+=	https://github.com/yaoweibin/nginx_syslog_patch/tarball/${GIT_SYSLOG_PATCH_VERSION}/:syslog_patch
-DISTFILES+=	nginx_syslog_patch-${GIT_SYSLOG_PATCH_VERSION}.tar.gz:syslog_patch
-CONFIGURE_ARGS+=	--add-module=${WRKDIR}/yaoweibin-nginx_syslog_patch-${GIT_SYSLOG_PATCH_VERSION}
+.if ${PORT_OPTIONS:MSTATSD}
+NGINX_STATSD_VERSION=	b756a12
+GH_ACCOUNT+=	zebrafishlabs:statsd
+GH_PROJECT+=	nginx-statsd:statsd
+GH_TAGNAME+=	${NGINX_STATSD_VERSION}:statsd
+CONFIGURE_ARGS+=--add-module=${WRKSRC_statsd}
 .endif
 
-.if ${PORT_OPTIONS:MTCP_PROXY}
-IGNORE=	TCP_PROXY: update require
-NGINX_TCP_PROXY_VERSION=	0.26
-GIT_TCP_PROXY_VERSION=	0-gb83e5a6
-MASTER_SITES+=	https://github.com/yaoweibin/nginx_tcp_proxy_module/tarball/v${NGINX_TCP_PROXY_VERSION}/:tcp_proxy
-DISTFILES+=	yaoweibin-nginx_tcp_proxy_module-v${NGINX_TCP_PROXY_VERSION}-${GIT_TCP_PROXY_VERSION}.tar.gz:tcp_proxy
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/yaoweibin-nginx_tcp_proxy_module-${GIT_TCP_PROXY_VERSION:S/^0-g//}
-.endif
-
 .if ${PORT_OPTIONS:MUDPLOG}
 NGINX_UDPLOG_VERSION=	1.0.0
 MASTER_SITES+=	http://www.grid.net.ru/nginx/download/:udplog
@@ -765,17 +836,18 @@
 
 .if ${PORT_OPTIONS:MXRID_HEADER}
 GIT_XRID_VERSION=	0daa3cc
-MASTER_SITES+=	https://github.com/gabor/nginx-x-rid-header/tarball/master/:xrid
-DISTFILES+=	gabor-nginx-x-rid-header-${GIT_XRID_VERSION}.tar.gz:xrid
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/gabor-nginx-x-rid-header-${GIT_XRID_VERSION}
+GH_ACCOUNT+=	gabor:xrid
+GH_PROJECT+=	nginx-x-rid-header:xrid
+GH_TAGNAME+=	${GIT_XRID_VERSION}:xrid
+CONFIGURE_ARGS+=--add-module=${WRKSRC_xrid}
 .endif
 
 .if ${PORT_OPTIONS:MXSS}
 NGINX_XSS_VERSION=	0.04
-GIT_XSS_VERSION=	0-g7e37038
-MASTER_SITES+=	https://github.com/openresty/xss-nginx-module/tarball/v${NGINX_XSS_VERSION}/:xss
-DISTFILES+=	openresty-xss-nginx-module-v${NGINX_XSS_VERSION}-${GIT_XSS_VERSION}.tar.gz:xss
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-xss-nginx-module-${GIT_XSS_VERSION:S/^0-g//}
+GH_ACCOUNT+=	openresty:xss
+GH_PROJECT+=	xss-nginx-module:xss
+GH_TAGNAME+=	v${NGINX_XSS_VERSION}:xss
+CONFIGURE_ARGS+=--add-module=${WRKSRC_xss}
 .endif
 
 .if ${PORT_OPTIONS:MSPDY}
@@ -784,6 +856,10 @@
 CONFIGURE_ARGS+=--with-http_spdy_module
 .endif
 
+.if ${PORT_OPTIONS:MTHREADS}
+CONFIGURE_ARGS+=--with-threads
+.endif
+
 .if ${PORT_OPTIONS:MWWW}
 PLIST_SUB+=	WWWDATA=""
 .else
@@ -819,27 +895,37 @@
 
 .if ${PORT_OPTIONS:MARRAYVAR}
 NGINX_ARRAYVAR_VERSION=	0.03
-GIT_ARRAYVAR_VERSION=	0-g4676747
-MASTER_SITES+=	https://github.com/openresty/array-var-nginx-module/tarball/v${NGINX_ARRAYVAR_VERSION}/:arrayvar
-DISTFILES+=	openresty-array-var-nginx-module-v${NGINX_ARRAYVAR_VERSION}-${GIT_ARRAYVAR_VERSION}.tar.gz:arrayvar
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/openresty-array-var-nginx-module-${GIT_ARRAYVAR_VERSION:S/^0-g//}
+GH_ACCOUNT+=	openresty:arrayvar
+GH_PROJECT+=	array-var-nginx-module:arrayvar
+GH_TAGNAME+=	v${NGINX_ARRAYVAR_VERSION}:arrayvar
+CONFIGURE_ARGS+=--add-module=${WRKSRC_arrayvar}
 .endif
 
+.if ${PORT_OPTIONS:MBROTLI}
+NGINX_BROTLI_VERSION=	86998c6
+LIB_DEPENDS+=	libbrotlidec.so:${PORTSDIR}/devel/libbrotli \
+		libbrotlienc.so:${PORTSDIR}/devel/libbrotli
+GH_ACCOUNT+=	google:brotli
+GH_PROJECT+=	ngx_brotli:brotli
+GH_TAGNAME+=	${NGINX_BROTLI_VERSION}:brotli
+CONFIGURE_ARGS+=--add-module=${WRKSRC_brotli}
+.endif
+
 .if ${PORT_OPTIONS:MFORMINPUT}
 NGINX_FORMINPUT_VERSION=	0.07
-GIT_FORMINPUT_VERSION=	0-g78de845
-MASTER_SITES+=	https://github.com/calio/form-input-nginx-module/tarball/v${NGINX_FORMINPUT_VERSION}/:forminput
-DISTFILES+=	calio-form-input-nginx-module-v${NGINX_FORMINPUT_VERSION}-${GIT_FORMINPUT_VERSION}.tar.gz:forminput
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/calio-form-input-nginx-module-${GIT_FORMINPUT_VERSION:S/^0-g//}
+GH_ACCOUNT+=	calio:forminput
+GH_PROJECT+=	form-input-nginx-module:forminput
+GH_TAGNAME+=	v${NGINX_FORMINPUT_VERSION}:forminput
+CONFIGURE_ARGS+=--add-module=${WRKSRC_forminput}
 .endif
 
 .if ${PORT_OPTIONS:MICONV}
 USES+=		iconv
 NGINX_ICONV_VERSION=	0.10
-GIT_ICONV_VERSION=	0-gb37efb5
-MASTER_SITES+=	https://github.com/calio/iconv-nginx-module/tarball/v${NGINX_ICONV_VERSION}/:iconv
-DISTFILES+=	calio-iconv-nginx-module-v${NGINX_ICONV_VERSION}-${GIT_ICONV_VERSION}.tar.gz:iconv
-CONFIGURE_ARGS+=--add-module=${WRKDIR}/calio-iconv-nginx-module-${GIT_ICONV_VERSION:S/^0-g//}
+GH_ACCOUNT+=	calio:iconv
+GH_PROJECT+=	iconv-nginx-module:iconv
+GH_TAGNAME+=	v${NGINX_ICONV_VERSION}:iconv
+CONFIGURE_ARGS+=--add-module=${WRKSRC_iconv}
 EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-calio-iconv-nginx-module-config
 .endif
 
@@ -851,9 +937,11 @@
 .if defined(NGINX_OPENSSL)
 USE_OPENSSL=	yes
 .if ${PORT_OPTIONS:MSPDY}
+.if ${OSVERSION} < 1000028
 WITH_OPENSSL_PORT=	yes
 .endif
 .endif
+.endif
 
 pre-everything::
 	@${ECHO_MSG}
@@ -867,10 +955,8 @@
 
 post-extract:
 .if ${PORT_OPTIONS:MGRIDFS}
-	@${RMDIR} ${WRKDIR}/mdirolf-nginx-gridfs-${GIT_GRIDFS_VERSION:S/^0-g//}/mongo-c-driver/
-	@${MV} \
-	${WRKDIR}/mongodb-mongo-c-driver-${GIT_MONGO_C_DRIVER_VERSION:S/^0-g//}/ \
-	${WRKDIR}/mdirolf-nginx-gridfs-${GIT_GRIDFS_VERSION:S/^0-g//}/mongo-c-driver/
+	@${RMDIR} ${WRKSRC_gridfs}/mongo-c-driver/
+	@${MV} ${WRKSRC_mongo_c} ${WRKSRC_gridfs}/mongo-c-driver
 .endif
 
 post-patch:
@@ -877,6 +963,11 @@
 	@${REINPLACE_CMD} 's!%%HTTP_PORT%%!${HTTP_PORT}!; \
 		s!%%PREFIX%%!${PREFIX}!' \
 		${WRKSRC}/conf/nginx.conf
+.if ${PORT_OPTIONS:MHTTP_AUTH_KRB5}
+	@${REINPLACE_CMD} \
+		's!%%GSSAPILIBS%%!${GSSAPILIBS}!' \
+		${WRKSRC_auth_krb5}/config
+.endif
 .if ${PORT_OPTIONS:MHTTP_ACCESSKEY}
 	@${REINPLACE_CMD} \
 		's!$$HTTP_ACCESSKEY_MODULE!ngx_http_accesskey_module!' \
@@ -888,16 +979,21 @@
 		's!^inline!static inline!' \
 		${WRKDIR}/mod_zip-${NGINX_ZIP_VERSION}/ngx_http_zip_parsers.*
 .endif
+.if ${PORT_OPTIONS:MCLOJURE}
+	@${REINPLACE_CMD} \
+		'54,57d' \
+		${WRKSRC_clojure}/src/c/config
+.endif
 .if ${PORT_OPTIONS:MDRIZZLE}
 	@${REINPLACE_CMD} \
 		's!%%PREFIX%%!${LOCALBASE}!g' \
-		${WRKDIR}/chaoslawful-drizzle-nginx-module-${GIT_DRIZZLE_VERSION:S/^0-g//}/config
+		${WRKSRC_drizzle}/config
 .endif
 # Respect CFLAGS by remove needless --std=c99 flag
 .if ${PORT_OPTIONS:MGRIDFS}
 	@${REINPLACE_CMD} \
 		's!--std=c99!-DMONGO_HAVE_STDINT!' \
-		${WRKDIR}/mdirolf-nginx-gridfs-${GIT_GRIDFS_VERSION:S/^0-g//}/config
+		${WRKSRC_gridfs}/config
 .endif
 .if ${PORT_OPTIONS:MPASSENGER}
 	@${REINPLACE_CMD} \
@@ -911,14 +1007,11 @@
 		s!-leio!!; \
 		s!-Iext/libeio!!' \
 		${WRKDIR}/passenger-${PASSENGER_VERSION}/build/common_library.rb
-	@${REINPLACE_CMD} \
-		's!-lpthread!${PTHREAD_LIBS}!g' \
-		${WRKDIR}/passenger-${PASSENGER_VERSION}/lib/phusion_passenger/platform_info/cxx_portability.rb
 .endif
 .if ${PORT_OPTIONS:MPOSTGRES}
 	@${REINPLACE_CMD} \
 		's!%%PREFIX%%!${LOCALBASE}!g' \
-		${WRKDIR}/ngx_postgres-${NGINX_POSTGRES_VERSION}/config
+		${WRKSRC_postgres}/config
 .endif
 .if ${PORT_OPTIONS:MSFLOW}
 	@${REINPLACE_CMD} \
@@ -925,100 +1018,73 @@
 		's!%%PREFIX%%!${LOCALBASE}!g' \
 		${WRKDIR}/nginx-sflow-module-${NGINX_SFLOW_VERSION}/ngx_http_sflow_config.h
 .endif
-.if ${PORT_OPTIONS:MSPDY}
-.if ${PORT_OPTIONS:MDRIZZLE}
-	@${REINPLACE_CMD} '589d' \
-		${WRKDIR}/chaoslawful-drizzle-nginx-module-${GIT_DRIZZLE_VERSION:S/^0-g//}/src/ngx_http_drizzle_util.c
-.endif
-.if ${PORT_OPTIONS:MLUA}
-	@${REINPLACE_CMD} '464d' \
-		${WRKDIR}/openresty-lua-nginx-module-${GIT_LUA_VERSION:S/^0-g//}/src/ngx_http_lua_socket_tcp.c
-.endif
-.endif
-.if ${PORT_OPTIONS:MSUPERVISORD}
-	( cd ${WRKDIR}/nginx_upstream_fair-${NGINX_UPSTREAM_FAIR_VERSION} && \
-		${PATCH} -p0 < \
-			${WRKDIR}/ngx_supervisord-${NGINX_SUPERVISORD_VERSION}/patches/ngx_http_upstream_fair_module.patch )
-	( cd ${WRKSRC} && \
-		${PATCH} -p0 < \
-			${WRKDIR}/ngx_supervisord-${NGINX_SUPERVISORD_VERSION}/patches/ngx_http_upstream_init_busy-0.8.17.patch )
-.endif
-.if ${PORT_OPTIONS:MTCP_PROXY}
-	( cd ${WRKSRC} && \
-		${PATCH} -p1 < \
-			${WRKDIR}/yaoweibin-nginx_tcp_proxy_module-${GIT_TCP_PROXY_VERSION:S/^0-g//}/tcp.patch )
-.endif
-.if ${PORT_OPTIONS:MSYSLOG_SUPPORT}
-	( cd ${WRKSRC} && \
-		${PATCH} -p1 < \
-			${WRKDIR}/yaoweibin-nginx_syslog_patch-${GIT_SYSLOG_PATCH_VERSION}/syslog-1.5.6.patch )
-.endif
 .if ${PORT_OPTIONS:MICONV}
 	@${REINPLACE_CMD} \
 		's!%%PREFIX%%!${LOCALBASE}!g' \
-		${WRKDIR}/calio-iconv-nginx-module-${GIT_ICONV_VERSION:S/^0-g//}/config
+		${WRKSRC_iconv}/config
 .endif
 .if ${PORT_OPTIONS:MMODSECURITY}
 	@${REINPLACE_CMD} \
 		's!%%PREFIX%%!${LOCALBASE}!g' \
-		${WRKDIR}/modsecurity-apache_${NGINX_MODSECURITY_VERSION}/nginx/modsecurity/config
+		${WRKDIR}/modsecurity-${NGINX_MODSECURITY_VERSION}/configure
 .endif
+.if ${PORT_OPTIONS:MHTTP_TARANTOOL}
+	@${REINPLACE_CMD} \
+		's!%%PREFIX%%!${LOCALBASE}!g' \
+		${WRKSRC_nginx_tarantool}/config
+.endif
 
 pre-configure:
 .if ${PORT_OPTIONS:MMODSECURITY}
-	( cd ${WRKDIR}/modsecurity-apache_${NGINX_MODSECURITY_VERSION} && \
+	( cd ${WRKDIR}/modsecurity-${NGINX_MODSECURITY_VERSION} && \
 		CC="${CC}" ./${CONFIGURE_SCRIPT} --enable-standalone-module && \
-		${MAKE} )
+		${SETENV} ${MAKE_ENV} ${MAKE_CMD} )
 .endif
+.if ${PORT_OPTIONS:MSMALL_LIGHT}
+	( cd ${WRKSRC_small_light} && ./setup )
+.endif
 
 do-build:
-	@cd ${WRKSRC} && ${MAKE}
+	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD}
 
 do-install:
-	${MKDIR} ${ETCDIR}
-	${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${PREFIX}/sbin
+	${MKDIR} ${STAGEDIR}${ETCDIR}
+	${MKDIR} ${STAGEDIR}${NGINX_TMPDIR}
+	${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${STAGEDIR}${PREFIX}/sbin
 .for i in koi-utf koi-win win-utf
-	${INSTALL_DATA} ${WRKSRC}/conf/${i} ${ETCDIR}
+	${INSTALL_DATA} ${WRKSRC}/conf/${i} ${STAGEDIR}${ETCDIR}
 .endfor
 .for i in fastcgi_params mime.types nginx.conf scgi_params uwsgi_params
-	[ -f ${ETCDIR}/${i} ] || \
-		${INSTALL_DATA} ${WRKSRC}/conf/${i} ${ETCDIR}
-	${INSTALL_DATA} ${WRKSRC}/conf/${i} ${ETCDIR}/${i}-dist
+	${INSTALL_DATA} ${WRKSRC}/conf/${i} ${STAGEDIR}${ETCDIR}/${i}-dist
 .endfor
 .if !empty(PORT_OPTIONS:MHTTP) && !empty(PORT_OPTIONS:MWWW)
-	${MKDIR} ${PREFIX}/www/nginx-dist
+	${MKDIR} ${STAGEDIR}${PREFIX}/www/nginx-dist
 .for i in index.html 50x.html
-	${INSTALL_DATA} ${WRKSRC}/html/${i} ${PREFIX}/www/nginx-dist
+	${INSTALL_DATA} ${WRKSRC}/html/${i} ${STAGEDIR}${PREFIX}/www/nginx-dist
 .endfor
-	${ECHO_CMD} "" >>${PREFIX}/www/nginx-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING
-	[ -e ${PREFIX}/www/nginx ] || \
-		${LN} -sf ${PREFIX}/www/nginx-dist ${PREFIX}/www/nginx
+	${ECHO_CMD} "" >>${STAGEDIR}${PREFIX}/www/nginx-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING
 .endif
 
 .if !empty(PORT_OPTIONS:MHTTP) && !empty(PORT_OPTIONS:MHTTP_PERL)
-	${MKDIR} ${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx
+	${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/nginx
 	${INSTALL_PROGRAM} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so \
-		${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx
-	${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs \
-		${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx
+		${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/nginx
 	${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \
-		${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/
+		${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/
 .endif
 
 .if ${PORT_OPTIONS:MNAXSI}
 	${INSTALL_DATA} \
-	${WRKDIR}/naxsi-core-${NGINX_NAXSI_VERSION}/naxsi_config/naxsi_core.rules \
-	${ETCDIR}
+	${WRKDIR}/naxsi-${NGINX_NAXSI_VERSION}/naxsi_config/naxsi_core.rules \
+	${STAGEDIR}${ETCDIR}
 .endif
 
 post-install:
 .if !empty(PORT_OPTIONS:MHTTP) && !empty(PORT_OPTIONS:MHTTP_PERL)
-	${ECHO_CMD} ${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx/nginx.so >> ${TMPPLIST}
-	${ECHO_CMD} ${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx/nginx.bs >> ${TMPPLIST}
-	${ECHO_CMD} ${SITE_PERL_REL}/${PERL_ARCH}/nginx.pm >> ${TMPPLIST}
-	${ECHO_CMD} @dirrm ${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx >> ${TMPPLIST}
+	${ECHO_CMD} ${SITE_ARCH_REL}/auto/nginx/nginx.so >> ${TMPPLIST}
+	${ECHO_CMD} ${SITE_ARCH_REL}/nginx.pm >> ${TMPPLIST}
 .endif
-	@${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${MAN8PREFIX}/man/man8
+	${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
 
 .if ${PORT_OPTIONS:MNAXSI}
 	${ECHO_CMD} etc/nginx/naxsi_core.rules >> ${TMPPLIST}

Modified: trunk/www/nginx/distinfo
===================================================================
--- trunk/www/nginx/distinfo	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/distinfo	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,120 +1,124 @@
-SHA256 (nginx-1.6.1.tar.gz) = f5cfe682a1aeef4602c2ca705402d5049b748f946563f41d8256c18674836067
-SIZE (nginx-1.6.1.tar.gz) = 803301
-SHA256 (nginx-1.6.0.tar.gz) = 943ad757a1c3e8b3df2d5c4ddacc508861922e36fa10ea6f8e3a348fc9abfc1a
-SIZE (nginx-1.6.0.tar.gz) = 802956
-SHA256 (giom-nginx_accept_language_module-2f69842.tar.gz) = fbcdf792160a1eff7b9549aeb5209d6e76716ff8e86b05e42c90b2d2f858e011
-SIZE (giom-nginx_accept_language_module-2f69842.tar.gz) = 3399
+SHA256 (nginx-1.8.1.tar.gz) = 8f4b3c630966c044ec72715754334d1fdf741caa1d5795fb4646c27d09f797b7
+SIZE (nginx-1.8.1.tar.gz) = 833473
 SHA256 (nginx-accesskey-2.0.3.tar.gz) = d9e94321e78a02de16c57f3e048fd31059fd8116ed03d6de7180f435c52502b1
 SIZE (nginx-accesskey-2.0.3.tar.gz) = 2632
-SHA256 (samizdatco-nginx-http-auth-digest-bd1c86a.tar.gz) = e223f55fd97e56425e232d8698e024707d1b2ed3714eff7d91a4d1ca76b4cbee
-SIZE (samizdatco-nginx-http-auth-digest-bd1c86a.tar.gz) = 14454
-SHA256 (http_auth_ldap-c4dc7c9153.tar.gz) = ac082a36afdbcfd883303bc2b1aaea5f2b4d2a772ad8eec9ecf3328e81300e1a
-SIZE (http_auth_ldap-c4dc7c9153.tar.gz) = 5323
 SHA256 (ngx_http_auth_pam_module-1.2.tar.gz) = 5a85970ba61a99f55a26d2536a11d512b39bbd622f5737d25a9a8c10db81efa9
 SIZE (ngx_http_auth_pam_module-1.2.tar.gz) = 5424
-SHA256 (ngx_http_auth_request_module-0.2.tar.gz) = eea5d0ec02bba93d0b204a034230cc61462b60497cbac6f581d7e008a9262ba4
-SIZE (ngx_http_auth_request_module-0.2.tar.gz) = 6736
-SHA256 (ngx_cache_purge-2.1.tar.gz) = 424005af0c04e59ffa65a65e446081d4f95ee76a801a7555e001c67810bcb3b9
-SIZE (ngx_cache_purge-2.1.tar.gz) = 10535
-SHA256 (ngx_ctpp2-0.5.tar.gz) = f8adfecc23e2c23af95df8549ef92fd52598b21506a9d9df2278b2605668d5a6
-SIZE (ngx_ctpp2-0.5.tar.gz) = 19686
-SHA256 (openresty-echo-nginx-module-v0.51-0-g44c92a5.tar.gz) = d4463cc6430bfd25a86ddf4a20d34fdb84899ff9dcc158af86d1bec9ec98da5c
-SIZE (openresty-echo-nginx-module-v0.51-0-g44c92a5.tar.gz) = 63469
-SHA256 (openresty-headers-more-nginx-module-v0.25-0-g0c6e05d.tar.gz) = e68077d6a1031aaf933373ece18ff8c21ae030798836d3334cf9925f931cb04b
-SIZE (openresty-headers-more-nginx-module-v0.25-0-g0c6e05d.tar.gz) = 27961
-SHA256 (arut-nginx-dav-ext-module-v0.0.2-0-g0e07a3e.tar.gz) = a0d6fa256e354ce48c06e1f689d26ebb2f7b75f71ce682e34ae6c29331a7fbff
-SIZE (arut-nginx-dav-ext-module-v0.0.2-0-g0e07a3e.tar.gz) = 6065
-SHA256 (vkholodkov-nginx-eval-module-1.0.3-0-g125fa2e.tar.gz) = 945046c42d973be9293e03ab41e3a0e04677524b2cd813cfc5146cf1d2f0ab8f
-SIZE (vkholodkov-nginx-eval-module-1.0.3-0-g125fa2e.tar.gz) = 5727
-SHA256 (ngx-fancyindex-0.3.1.tar.gz) = 877e383c6bc06be92abb88f5ac251a165b63feb5f4828d52a554efc19a3f7c7d
-SIZE (ngx-fancyindex-0.3.1.tar.gz) = 13071
+SHA256 (ngx_cache_purge-2.3.tar.gz) = 279e0d8a46d3b1521fd43b3f78bc1c08b263899142a7cc5058c1c0361a92c89c
+SIZE (ngx_cache_purge-2.3.tar.gz) = 12248
 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 (kr-nginx-notice-0-g3c95966.tar.gz) = bb0b8c603b2df206aeb13100fb60c1328aa6a69d0ac7f411e5dabe8fdb2affce
-SIZE (kr-nginx-notice-0-g3c95966.tar.gz) = 3348
-SHA256 (nginx_http_push_module-0.692.tar.gz) = 64868708071aa21dbc4c7a07d149dd6ec9108fb7eaf2aad5ad069406151f17fe
-SIZE (nginx_http_push_module-0.692.tar.gz) = 29119
-SHA256 (wandenberg-nginx-push-stream-module-0.3.5-0-gb6a8c46.tar.gz) = f2c5b2cc3430f023442381b734a1e547dd2ba75a05cd34f2cdcf2431acc4f77e
-SIZE (wandenberg-nginx-push-stream-module-0.3.5-0-gb6a8c46.tar.gz) = 153187
-SHA256 (ngx_http_redis-0.3.7.tar.gz) = 9dfc14db81f431fdf3d69f3661a37daf110aef5f9479aa7c88cf362bb5d62604
-SIZE (ngx_http_redis-0.3.7.tar.gz) = 12165
+SHA256 (ngx_http_redis-0.3.8.tar.gz) = 95d0ed7be40da2efc88883d72e52e5e272d2c34463583b7078e8fd6d55004934
+SIZE (ngx_http_redis-0.3.8.tar.gz) = 12342
 SHA256 (ngx_http_response-0.3.tar.gz) = 0835584029f053051c624adbe33a826ab0205c9d85a02af6019e6b57607e9045
 SIZE (ngx_http_response-0.3.tar.gz) = 2244
-SHA256 (yaoweibin-ngx_http_substitutions_filter_module-0.6.2-0-g27a01b3.tar.gz) = 81864aa6ca85df70d55a2574ce8aefd21ad7ea88fc012a328e59c125e56d1e77
-SIZE (yaoweibin-ngx_http_substitutions_filter_module-0.6.2-0-g27a01b3.tar.gz) = 91895
-SHA256 (nginx_upload_module-2.2.0.tar.gz) = b1c26abe0427180602e257627b4ed21848c93cc20cefc33af084983767d65805
-SIZE (nginx_upload_module-2.2.0.tar.gz) = 25796
-SHA256 (masterzen-nginx-upload-progress-module-v0.9.0-0-ga788dea.tar.gz) = 3fb903dab595cf6656fa0fc5743a48daffbba2f6b5c554836be630800eaad4e2
-SIZE (masterzen-nginx-upload-progress-module-v0.9.0-0-ga788dea.tar.gz) = 17020
 SHA256 (nginx_upstream_fair-20090923.tar.gz) = ec9ed7f856263e17faadee3dc7209932364ded4e546b829841c2454aa432450b
 SIZE (nginx_upstream_fair-20090923.tar.gz) = 10024
-SHA256 (Nginx_upstream_hash-0.3.1.tar.gz) = 51929c5352d4c2608b3f852987830be08b6946baf20da346fe520d9b12e39968
-SIZE (Nginx_upstream_hash-0.3.1.tar.gz) = 5049
-SHA256 (nginx-sticky-module-1.1.tar.gz) = 6c18334d29d055bf9f21d59f9e9fb093e4dad017577f54b37c9358d315b05587
-SIZE (nginx-sticky-module-1.1.tar.gz) = 115412
+SHA256 (1.2.4.tar.gz) = f79521a25322cb4f504547a0b0f76fd9d024c14440e5d790e26dda70ea4f701a
+SIZE (1.2.4.tar.gz) = 120448
 SHA256 (mod_zip-1.1.6.tar.gz) = d30546b4be8308c721df0240ebc38c474c6b577381a110321eded6dbed5104b1
 SIZE (mod_zip-1.1.6.tar.gz) = 21991
-SHA256 (chaoslawful-drizzle-nginx-module-v0.1.7-0-gb83a8a9.tar.gz) = 7687f119343b2246257ad7269a940e7ca03a1939b8032b444317037f6417fec7
-SIZE (chaoslawful-drizzle-nginx-module-v0.1.7-0-gb83a8a9.tar.gz) = 58730
-SHA256 (simpl-ngx_devel_kit-v0.2.19-0-g8dd0df5.tar.gz) = 9a8c372f8e750d33018d9587d288c17f755e8da38592bca8ef9bf9ea4bab59a7
-SIZE (simpl-ngx_devel_kit-v0.2.19-0-g8dd0df5.tar.gz) = 65033
-SHA256 (openresty-encrypted-session-nginx-module-v0.03-0-g49d741b.tar.gz) = 0c8b74f2fbe6114f6d59fecbf3539f5d13944f40895d1c379fdb5dfb0838c1e3
-SIZE (openresty-encrypted-session-nginx-module-v0.03-0-g49d741b.tar.gz) = 8954
-SHA256 (mdirolf-nginx-gridfs-v0.8-0-gb5f8113.tar.gz) = f55617873c9b123d610d59e4da52703c07be0bae5c719ef0cc3d45a53480d29c
-SIZE (mdirolf-nginx-gridfs-v0.8-0-gb5f8113.tar.gz) = 18882
-SHA256 (mongodb-mongo-c-driver-v0.3.1-0-g9b4b232.tar.gz) = bfcdd60c6b53bd499e2bf22fefc96848de37e7d57dfaf7303bb00376dcb812f0
-SIZE (mongodb-mongo-c-driver-v0.3.1-0-g9b4b232.tar.gz) = 53033
-SHA256 (arut-nginx-let-module-v0.0.4-0-ga5e1dc5.tar.gz) = 9253581f11966329f64b4b4a49a2a60798665812f9007222592586e64bcd66da
-SIZE (arut-nginx-let-module-v0.0.4-0-ga5e1dc5.tar.gz) = 20543
-SHA256 (openresty-lua-nginx-module-v0.9.4-0-g6169a19.tar.gz) = 4d869650d03a76d2811715aa10c962162315603b65794475be8aec682db29f4a
-SIZE (openresty-lua-nginx-module-v0.9.4-0-g6169a19.tar.gz) = 470182
-SHA256 (openresty-memc-nginx-module-v0.14-0-gde4cf86.tar.gz) = b60fed5921a0c19c6ffe71e5c764193283dbe635bb3bad6febd6655f94a633e9
-SIZE (openresty-memc-nginx-module-v0.14-0-gde4cf86.tar.gz) = 37756
-SHA256 (modsecurity-apache_2.7.5.tar.gz) = 9e907536278d8da80d3dbb29aeffe9c4ec37ce9b641035b2da64e993135647a2
-SIZE (modsecurity-apache_2.7.5.tar.gz) = 1045387
-SHA256 (naxsi-core-0.50.tgz) = 7cece5f9d9c5df9e09af1e1023bc8e04bbbbe953e67461b893b8240e82ca52ef
-SIZE (naxsi-core-0.50.tgz) = 49809
-SHA256 (passenger-4.0.45.tar.gz) = 5363611ebe5086b1ba699057ead3af1c06d0a70f368d1a41bdc399a45f934579
-SIZE (passenger-4.0.45.tar.gz) = 4363360
-SHA256 (ngx_postgres-0.9.tar.gz) = aac0141e73b5c440927b7e040072f120b36e49deb2ff36ad00ff96a80622fbec
-SIZE (ngx_postgres-0.9.tar.gz) = 41022
-SHA256 (openresty-rds-csv-nginx-module-v0.05-0-g607e26b.tar.gz) = d5f14e45c6dc0d039ad52ae889775b5af1ff80a1c8edb69361c1581aca5d0b8f
-SIZE (openresty-rds-csv-nginx-module-v0.05-0-g607e26b.tar.gz) = 18416
-SHA256 (openresty-rds-json-nginx-module-v0.13-0-g8292070.tar.gz) = e0813f2d1e0d499c4f44f7957253c7804ccc0d3a7d4446ac0c6eec834e9c21f4
-SIZE (openresty-rds-json-nginx-module-v0.13-0-g8292070.tar.gz) = 32961
-SHA256 (openresty-redis2-nginx-module-v0.10-0-g78a7622.tar.gz) = 76606bf3b548b072f8a6426033c115d013c52068f174f61d21c671435087e97d
-SIZE (openresty-redis2-nginx-module-v0.10-0-g78a7622.tar.gz) = 29850
-SHA256 (alibaba-nginx-footer-filter-1.2.2-0-g3572184.tar.gz) = 48a23f879416c0d8da5795c419b94f1ffa42ee06602545f494db4d9aba646e8f
-SIZE (alibaba-nginx-footer-filter-1.2.2-0-g3572184.tar.gz) = 3934
-SHA256 (rtmp-nginx-module-v1.1.4.tar.gz) = 076efef9698076fa23622e093cfb3959e4d14fcd6e9dcdf0b8e6d9154c720dc9
-SIZE (rtmp-nginx-module-v1.1.4.tar.gz) = 517774
-SHA256 (openresty-set-misc-nginx-module-v0.24-0-g36fd035.tar.gz) = 5475877d67a952beaf0b726b96d0c9abf48ccfc27367a6bebb5738e04d054a76
-SIZE (openresty-set-misc-nginx-module-v0.24-0-g36fd035.tar.gz) = 40390
+SHA256 (modsecurity-2.9.1-RC1.tar.gz) = 86fd2462c556a11f812d76a3b97716cec2de0e81ee0a095d8280fdd6be384455
+SIZE (modsecurity-2.9.1-RC1.tar.gz) = 4265101
+SHA256 (passenger-5.0.26.tar.gz) = de3b63b65ff27d193096361a330d9db1dc07076c1ba9be5ecee90322d91dbbc9
+SIZE (passenger-5.0.26.tar.gz) = 5321762
 SHA256 (nginx-sflow-module-0.9.7.tar.gz) = 508d15a43059abab08281bfa66d2dd520e2e7635d0b17043549bb331c8755b76
 SIZE (nginx-sflow-module-0.9.7.tar.gz) = 27614
 SHA256 (ngx_slowfs_cache-1.10.tar.gz) = 1e81453942e5b0877de1f1f06c56ae82918ea9818255cb935bcb673c95a758a1
 SIZE (ngx_slowfs_cache-1.10.tar.gz) = 11809
-SHA256 (openresty-srcache-nginx-module-v0.25-0-gf25fe90.tar.gz) = 3613c2796f4b55dcfc49a25ddcb25eef4cd1c4b240a7f0df98c20538f1f9d3e5
-SIZE (openresty-srcache-nginx-module-v0.25-0-gf25fe90.tar.gz) = 57299
-SHA256 (ngx_supervisord-1.4.tar.gz) = 0954a4efb1b955692acf523e169221146d6aa93ad1643c9f2482f75a1fbf9e3b
-SIZE (ngx_supervisord-1.4.tar.gz) = 19351
-SHA256 (yaoweibin-nginx_tcp_proxy_module-v0.26-0-gb83e5a6.tar.gz) = 4d843b8d0511b269382938ba5546f902ec24dbfa76c12f6bd6961d7aaaf3866a
-SIZE (yaoweibin-nginx_tcp_proxy_module-v0.26-0-gb83e5a6.tar.gz) = 127346
 SHA256 (nginx_udplog_module-1.0.0.tar.gz) = e0c0bfa524c3a675ad6c08b916d08e57ef45f9818cb8a0d848c2c83785c6e659
 SIZE (nginx_udplog_module-1.0.0.tar.gz) = 6284
-SHA256 (gabor-nginx-x-rid-header-0daa3cc.tar.gz) = 136239b8f9ab2fbefb2aabc6897d3f12cc8063ce817901f9b8a624e12fbc6035
-SIZE (gabor-nginx-x-rid-header-0daa3cc.tar.gz) = 2714
-SHA256 (openresty-xss-nginx-module-v0.04-0-g7e37038.tar.gz) = 0199bc3b53269f49073365fe08dc2c02decbaea614dc33db4666c7ab2cdb8bfa
-SIZE (openresty-xss-nginx-module-v0.04-0-g7e37038.tar.gz) = 10542
-SHA256 (openresty-array-var-nginx-module-v0.03-0-g4676747.tar.gz) = bc33d26af3f01882a187b312c27fb547f802eb36eedfa7d2caedf3ed9c424442
-SIZE (openresty-array-var-nginx-module-v0.03-0-g4676747.tar.gz) = 9518
-SHA256 (calio-form-input-nginx-module-v0.07-0-g78de845.tar.gz) = d5b2c42a3b9fd2970107eb74c2226cbbfbad48c89807303db903932d21ff76aa
-SIZE (calio-form-input-nginx-module-v0.07-0-g78de845.tar.gz) = 10580
-SHA256 (calio-iconv-nginx-module-v0.10-0-gb37efb5.tar.gz) = e90a406a14d5f419bd500e19082da81390e8ba6040926857926f1a899a53379d
-SIZE (calio-iconv-nginx-module-v0.10-0-gb37efb5.tar.gz) = 12510
-SHA256 (1.2.4.tar.gz) = f79521a25322cb4f504547a0b0f76fd9d024c14440e5d790e26dda70ea4f701a
-SIZE (1.2.4.tar.gz) = 120448
-SHA256 (nginx_syslog_patch-3ca5ba6.tar.gz) = 817a207f2cb18f3035f5535bd03942390010dbade03c4a5d3d0d97b55e1f3deb
-SIZE (nginx_syslog_patch-3ca5ba6.tar.gz) = 94400
+SHA256 (giom-nginx_accept_language_module-2f69842_GH0.tar.gz) = 5534ca63cdfc2a7dc4e1cbf9c2d54d3ed3f0e6c86b4a95be48ec0a3f41cc1eb0
+SIZE (giom-nginx_accept_language_module-2f69842_GH0.tar.gz) = 3393
+SHA256 (samizdatco-nginx-http-auth-digest-bd1c86a_GH0.tar.gz) = d3071ca4b70cfd7f437add772a2aa6ab585dafb5d5a2e3f5cc70af74da72acf2
+SIZE (samizdatco-nginx-http-auth-digest-bd1c86a_GH0.tar.gz) = 14458
+SHA256 (stnoonan-spnego-http-auth-nginx-module-c85a38c_GH0.tar.gz) = b47b23a362aa338c377d6163d15abee6f33ff16bac5f86ee4d9543293fe8c4d1
+SIZE (stnoonan-spnego-http-auth-nginx-module-c85a38c_GH0.tar.gz) = 18120
+SHA256 (kvspb-nginx-auth-ldap-8517bb0_GH0.tar.gz) = a69cf8d5490620d5507d712fa234e137d9404e9c250563f2eb421eafa6209975
+SIZE (kvspb-nginx-auth-ldap-8517bb0_GH0.tar.gz) = 16947
+SHA256 (yaoweibin-nginx_ajp_module-bf6cd93_GH0.tar.gz) = 9e3f78ea73e2d606a95ee64fd3affa4c249f9b342e66b6b11b63061791f28316
+SIZE (yaoweibin-nginx_ajp_module-bf6cd93_GH0.tar.gz) = 109704
+SHA256 (nginx-clojure-nginx-clojure-v0.4.3_GH0.tar.gz) = fba7db2d16c0a2cf9a8d759baa6fdde1176bb9a4f0c747a218d3efd9f37298e8
+SIZE (nginx-clojure-nginx-clojure-v0.4.3_GH0.tar.gz) = 589270
+SHA256 (grahamedgecombe-nginx-ct-f3cad5e_GH0.tar.gz) = 846e148f09ffea2ffc1b09b20c84408e23c170313f967513a85009717227c13a
+SIZE (grahamedgecombe-nginx-ct-f3cad5e_GH0.tar.gz) = 5521
+SHA256 (openresty-echo-nginx-module-4f7aa50_GH0.tar.gz) = 7b8bb5139001306a46f8e9ce0b7d09befff2f49741ecc6eb47299518764defcd
+SIZE (openresty-echo-nginx-module-4f7aa50_GH0.tar.gz) = 52144
+SHA256 (openresty-headers-more-nginx-module-f5559ec_GH0.tar.gz) = 422b12414a6f850cbb3ee96c225e5259eef4e949f70e63e27e6583ce3eb836ff
+SIZE (openresty-headers-more-nginx-module-f5559ec_GH0.tar.gz) = 27400
+SHA256 (arut-nginx-dav-ext-module-v0.0.3_GH0.tar.gz) = d428a0236c933779cb40ac8c91afb19d5c25a376dc3caab825bfd543e1ee530d
+SIZE (arut-nginx-dav-ext-module-v0.0.3_GH0.tar.gz) = 6260
+SHA256 (openresty-nginx-eval-module-342c812_GH0.tar.gz) = c45f6438474593f0cf5229160327d20c2f2d72e9c0b5c8cf9e0ef8d5295de177
+SIZE (openresty-nginx-eval-module-342c812_GH0.tar.gz) = 14183
+SHA256 (aperezdc-ngx-fancyindex-v0.3.6_GH0.tar.gz) = e73f1f0444f8c53601b51da8684b174c5ffd3b4ed6eb7956dd57f8b95485b68f
+SIZE (aperezdc-ngx-fancyindex-v0.3.6_GH0.tar.gz) = 17252
+SHA256 (alibaba-nginx-http-footer-filter-1.2.2_GH0.tar.gz) = 3493b54460c59370f9f60c6e662862752f1920fc6e684f7a66bb2b3260692813
+SIZE (alibaba-nginx-http-footer-filter-1.2.2_GH0.tar.gz) = 3934
+SHA256 (nginx-modules-ngx_http_json_status_module-1d2f303_GH0.tar.gz) = fdc34e0e712d28f4452ce3858ba05a38cc00703f14502095189c4a1063a36997
+SIZE (nginx-modules-ngx_http_json_status_module-1d2f303_GH0.tar.gz) = 6736
+SHA256 (kr-nginx-notice-3c95966_GH0.tar.gz) = e829fc94178cc8c91fef15a1fc44ee7ac162c13eddc0bba4c9427aaa23386885
+SIZE (kr-nginx-notice-3c95966_GH0.tar.gz) = 3343
+SHA256 (slact-nchan-v0.99.5_GH0.tar.gz) = 24e0bd3489aed50a5f43c3541723a5ed5d52f7750e967c4f16e62f5eddc6af2e
+SIZE (slact-nchan-v0.99.5_GH0.tar.gz) = 337474
+SHA256 (wandenberg-nginx-push-stream-module-0.5.1_GH0.tar.gz) = a95f31e80120fd7324795b92a0d94c0b43e1265df7fd0f1eba11a337c1e0a626
+SIZE (wandenberg-nginx-push-stream-module-0.5.1_GH0.tar.gz) = 175263
+SHA256 (yaoweibin-ngx_http_substitutions_filter_module-v0.6.4_GH0.tar.gz) = ed4ddbcf0c434f4a1e97b61251a63ace759792764bd5cb79ff20efe348db8db3
+SIZE (yaoweibin-ngx_http_substitutions_filter_module-v0.6.4_GH0.tar.gz) = 92230
+SHA256 (tarantool-nginx_upstream_module-966f2f5_GH0.tar.gz) = 8142475d8ecf0c02d2fc8051364729d842fe06b0b445b416c87c2f796bb42fa7
+SIZE (tarantool-nginx_upstream_module-966f2f5_GH0.tar.gz) = 873343
+SHA256 (vkholodkov-nginx-upload-module-aba1e3f34c_GH0.tar.gz) = 62a2c4388585aec463a1cee30bc84953593a93f341dc1df61b42b452594d2a05
+SIZE (vkholodkov-nginx-upload-module-aba1e3f34c_GH0.tar.gz) = 28296
+SHA256 (masterzen-nginx-upload-progress-module-v0.9.0_GH0.tar.gz) = 93e29b9b437a2e34713de54c2861ea51151624aca09f73f9f44d1caaff01a6b1
+SIZE (masterzen-nginx-upload-progress-module-v0.9.0_GH0.tar.gz) = 16990
+SHA256 (openresty-drizzle-nginx-module-v0.1.9_GH0.tar.gz) = aafb79d87273eec023025333c34d6d0108026a1ce2e09b20a53e8e2d9bf65080
+SIZE (openresty-drizzle-nginx-module-v0.1.9_GH0.tar.gz) = 59024
+SHA256 (simpl-ngx_devel_kit-v0.2.19_GH0.tar.gz) = 501f299abdb81b992a980bda182e5de5a4b2b3e275fbf72ee34dd7ae84c4b679
+SIZE (simpl-ngx_devel_kit-v0.2.19_GH0.tar.gz) = 65029
+SHA256 (openresty-encrypted-session-nginx-module-v0.03_GH0.tar.gz) = 4d0da617b3122b145dd46ec8618c6248db79c992704b23ed78e01bddf14173d3
+SIZE (openresty-encrypted-session-nginx-module-v0.03_GH0.tar.gz) = 8949
+SHA256 (mdirolf-nginx-gridfs-v0.8_GH0.tar.gz) = ef843824e0aac1dd60b392802861cc06426a4bc5f87d472c7ee00b1296693f2a
+SIZE (mdirolf-nginx-gridfs-v0.8_GH0.tar.gz) = 18883
+SHA256 (mongodb-mongo-c-driver-v0.3.1_GH0.tar.gz) = 552c54aff81c4701ace4eb1ce20c114433ee783b4b06c0105921a830c9486172
+SIZE (mongodb-mongo-c-driver-v0.3.1_GH0.tar.gz) = 53024
+SHA256 (arut-nginx-let-module-v0.0.4_GH0.tar.gz) = cbf6fcddc00a7e30289134bdeace12565e000cc7d4efee2d2ebb8799d0b88270
+SIZE (arut-nginx-let-module-v0.0.4_GH0.tar.gz) = 20534
+SHA256 (openresty-lua-nginx-module-7410339_GH0.tar.gz) = 1b78f243ea95efcfd6f5bda43fbe5849bff931b9620d22c75b3de6590e09c684
+SIZE (openresty-lua-nginx-module-7410339_GH0.tar.gz) = 574764
+SHA256 (openresty-memc-nginx-module-v0.16_GH0.tar.gz) = 24f3c3270831aed2d157c01ef74cb26eab26b832971fe7b9f42a03dbfac10ce4
+SIZE (openresty-memc-nginx-module-v0.16_GH0.tar.gz) = 38560
+SHA256 (nbs-system-naxsi-0.54_GH0.tar.gz) = 9cc2c09405bc71f78ef26a8b6d70afcea3fccbe8125df70cb0cfc480133daba5
+SIZE (nbs-system-naxsi-0.54_GH0.tar.gz) = 163809
+SHA256 (FRiCKLE-ngx_postgres-1.0rc7_GH0.tar.gz) = c942e674a7273ab87caab4dcad626ab54852be192c29b1add50d2cb535e3cbb9
+SIZE (FRiCKLE-ngx_postgres-1.0rc7_GH0.tar.gz) = 40742
+SHA256 (openresty-rds-csv-nginx-module-v0.07_GH0.tar.gz) = b204909c6fb194fe8fed7627a3733bc9598f64251dc04a5b6a5bbd612e925324
+SIZE (openresty-rds-csv-nginx-module-v0.07_GH0.tar.gz) = 19444
+SHA256 (openresty-rds-json-nginx-module-v0.14_GH0.tar.gz) = 99aedf222a9664484918392988cce41b1a6238240d42f8bd44f5ff102c05c36c
+SIZE (openresty-rds-json-nginx-module-v0.14_GH0.tar.gz) = 33496
+SHA256 (openresty-redis2-nginx-module-v0.12_GH0.tar.gz) = baf5274c815a5f27854747df09ff5bcd6d82e0baa2f224a9db6450d2f3a35a4f
+SIZE (openresty-redis2-nginx-module-v0.12_GH0.tar.gz) = 28981
+SHA256 (arut-nginx-rtmp-module-v1.1.7_GH0.tar.gz) = 7922b0e3d5f3d9c4b275e4908cfb8f5fb1bfb3ac2df77f4c262cda56df21aab3
+SIZE (arut-nginx-rtmp-module-v1.1.7_GH0.tar.gz) = 519735
+SHA256 (openresty-set-misc-nginx-module-6582fb4_GH0.tar.gz) = cc325830477dfcdbb355fc7b19cbc2f4e55c179b3b56fdfe0613b5a7b926235e
+SIZE (openresty-set-misc-nginx-module-6582fb4_GH0.tar.gz) = 35961
+SHA256 (nginx-shib-nginx-http-shibboleth-v20150121_GH0.tar.gz) = e38a19bb4d30e5487c013c4b6b3e3d5b96de82d63b776471cc2c381a5d00374d
+SIZE (nginx-shib-nginx-http-shibboleth-v20150121_GH0.tar.gz) = 10106
+SHA256 (cubicdaiya-ngx_small_light-v0.6.15_GH0.tar.gz) = 9bc9c221287a6db56a4a0eb7ac35a560fc15dfd6dafcb500fdea49a583527716
+SIZE (cubicdaiya-ngx_small_light-v0.6.15_GH0.tar.gz) = 54695
+SHA256 (openresty-srcache-nginx-module-v0.30_GH0.tar.gz) = e34b1ab5f5007661f73819f9c20fd6c2a46ed3e53364e9449b02ef2bd3628633
+SIZE (openresty-srcache-nginx-module-v0.30_GH0.tar.gz) = 58777
+SHA256 (zebrafishlabs-nginx-statsd-b756a12_GH0.tar.gz) = 4c5886edb1fbeb0b9a83c879b4be4b15a620627a18978aef636da3feafb284fe
+SIZE (zebrafishlabs-nginx-statsd-b756a12_GH0.tar.gz) = 6636
+SHA256 (gabor-nginx-x-rid-header-0daa3cc_GH0.tar.gz) = de784142d867a35ecc5443fa347c2903af0935669cdf2eaa9274f5253aac2267
+SIZE (gabor-nginx-x-rid-header-0daa3cc_GH0.tar.gz) = 2711
+SHA256 (openresty-xss-nginx-module-v0.04_GH0.tar.gz) = 4e5230a644779b8298063d5c0bd7dc19531496369456d69dc5281ae1cca4d6ec
+SIZE (openresty-xss-nginx-module-v0.04_GH0.tar.gz) = 10536
+SHA256 (openresty-array-var-nginx-module-v0.03_GH0.tar.gz) = f9892ec9a2e872d8aabeb2234d0d4c66cf85b8dbb2ca5c108a20c3d8c2111189
+SIZE (openresty-array-var-nginx-module-v0.03_GH0.tar.gz) = 9520
+SHA256 (google-ngx_brotli-86998c6_GH0.tar.gz) = 463a583cfbeacdf6d6db5630afaddc9eebeec44301ca68c660cc8fdf4580e5aa
+SIZE (google-ngx_brotli-86998c6_GH0.tar.gz) = 10890
+SHA256 (calio-form-input-nginx-module-v0.07_GH0.tar.gz) = c0c56cc697a290e98b88d4888bac8828041ef6f3049247d3cd3c63f2808d1e20
+SIZE (calio-form-input-nginx-module-v0.07_GH0.tar.gz) = 10563
+SHA256 (calio-iconv-nginx-module-v0.10_GH0.tar.gz) = 88e326eba7fdf9fd2376b1ba033b48cb0eee45136528cf5430ac9340088ce324
+SIZE (calio-iconv-nginx-module-v0.10_GH0.tar.gz) = 12513

Deleted: trunk/www/nginx/files/extra-patch-agentzh-set-misc-nginx-module-config
===================================================================
--- trunk/www/nginx/files/extra-patch-agentzh-set-misc-nginx-module-config	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/extra-patch-agentzh-set-misc-nginx-module-config	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,13 +0,0 @@
---- ../agentzh-set-misc-nginx-module-36fd035/config.orig       2011-12-09 10:27:53.861265188 +0300
-+++ ../agentzh-set-misc-nginx-module-36fd035/config    2011-12-09 10:28:07.107259301 +0300
-@@ -1,10 +1,3 @@
--if echo $HTTP_MODULES | grep " ndk_http_module" > /dev/null; then
--    echo "found ngx_devel_kit for ngx_set_misc; looks good."
--else
--    echo "error: ngx_devel_kit is required to build ngx_set_misc; please put it before ngx_set_misc." 1>&2
--    exit 1
--fi
--
- ngx_addon_name=ngx_http_set_misc_module
- HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_set_misc_module"
- NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_set_base32.c $ngx_addon_dir/src/ngx_http_set_default_value.c $ngx_addon_dir/src/ngx_http_set_hashed_upstream.c $ngx_addon_dir/src/ngx_http_set_quote_sql.c $ngx_addon_dir/src/ngx_http_set_quote_json.c $ngx_addon_dir/src/ngx_http_set_unescape_uri.c $ngx_addon_dir/src/ngx_http_set_misc_module.c $ngx_addon_dir/src/ngx_http_set_escape_uri.c $ngx_addon_dir/src/ngx_http_set_hash.c $ngx_addon_dir/src/ngx_http_set_local_today.c $ngx_addon_dir/src/ngx_http_set_hex.c $ngx_addon_dir/src/ngx_http_set_base64.c $ngx_addon_dir/src/ngx_http_set_random.c"

Modified: trunk/www/nginx/files/extra-patch-calio-iconv-nginx-module-config
===================================================================
--- trunk/www/nginx/files/extra-patch-calio-iconv-nginx-module-config	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/extra-patch-calio-iconv-nginx-module-config	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,5 +1,5 @@
---- ../calio-iconv-nginx-module-b37efb5/config.orig	2013-04-16 17:57:17.000000000 -0700
-+++ ../calio-iconv-nginx-module-b37efb5/config	2013-05-01 17:16:28.134624745 -0700
+--- ../iconv-nginx-module-0.10/config.orig	2013-04-16 17:57:17.000000000 -0700
++++ ../iconv-nginx-module-0.10/config	2013-05-01 17:16:28.134624745 -0700
 @@ -39,12 +39,12 @@
      fi
  

Deleted: trunk/www/nginx/files/extra-patch-chaoslawful-drizzle-nginx-module-config
===================================================================
--- trunk/www/nginx/files/extra-patch-chaoslawful-drizzle-nginx-module-config	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/extra-patch-chaoslawful-drizzle-nginx-module-config	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,19 +0,0 @@
---- ../chaoslawful-drizzle-nginx-module-b83a8a9/config.orig	2011-12-30 10:26:53.000000000 +0400
-+++ ../chaoslawful-drizzle-nginx-module-b83a8a9/config	2011-12-30 10:28:20.000000000 +0400
-@@ -22,12 +22,12 @@
- 
-     if [ $ngx_found = no ]; then
-         # FreeBSD, OpenBSD
--        ngx_feature="libdrizzle library in /usr/local/"
--        ngx_feature_path="/usr/local/include/libdrizzle-1.0"
-+        ngx_feature="libdrizzle library in %%PREFIX%%"
-+        ngx_feature_path="%%PREFIX%%/include/libdrizzle"
-         if [ $NGX_RPATH = YES ]; then
--            ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -ldrizzle"
-+            ngx_feature_libs="-R%%PREFIX%%/lib -L%%PREFIX%%/lib -ldrizzle"
-         else
--            ngx_feature_libs="-L/usr/local/lib -ldrizzle"
-+            ngx_feature_libs="-L%%PREFIX%%/lib -ldrizzle"
-         fi
-         . auto/feature
-     fi

Deleted: trunk/www/nginx/files/extra-patch-nginx-modsecurity-config
===================================================================
--- trunk/www/nginx/files/extra-patch-nginx-modsecurity-config	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/extra-patch-nginx-modsecurity-config	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,10 +0,0 @@
---- ../modsecurity-apache_2.7.5/nginx/modsecurity/config.orig	2013-06-04 10:14:07.000000000 +0400
-+++ ../modsecurity-apache_2.7.5/nginx/modsecurity/config	2013-06-04 10:17:30.000000000 +0400
-@@ -3,5 +3,5 @@
- HTTP_AUX_FILTER_MODULES="ngx_http_modsecurity $HTTP_AUX_FILTER_MODULES"
- NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_modsecurity.c $ngx_addon_dir/apr_bucket_nginx.c $ngx_addon_dir/ngx_pool_context.c"
- NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/apr_bucket_nginx.h $ngx_addon_dir/ngx_pool_context.h"
--CORE_LIBS="$CORE_LIBS $ngx_addon_dir/../../standalone/.libs/standalone.a -L/usr/local/apr/lib -lapr-1  -L/usr/local/apr/lib -laprutil-1 -lpcre -lxml2 -lz -lm -ldl  "
--CORE_INCS="$CORE_INCS $ngx_addon_dir $ngx_addon_dir/../../standalone $ngx_addon_dir/../../apache2 /usr/include/libxml2  /usr/local/apache2/include /usr/local/apr/include/apr-1 /usr/local/apr/include/apr-1"
-+CORE_LIBS="$CORE_LIBS $ngx_addon_dir/../../standalone/.libs/standalone.a -lapr-1 -laprutil-1 -lpcre -lxml2 -lz -lm "
-+CORE_INCS="$CORE_INCS $ngx_addon_dir $ngx_addon_dir/../../standalone $ngx_addon_dir/../../apache2 %%PREFIX%%/include/libxml2  %%PREFIX%%/include/apache22 %%PREFIX%%/include/apr-1 "

Added: trunk/www/nginx/files/extra-patch-nginx-modsecurity-configure
===================================================================
--- trunk/www/nginx/files/extra-patch-nginx-modsecurity-configure	                        (rev 0)
+++ trunk/www/nginx/files/extra-patch-nginx-modsecurity-configure	2016-03-04 23:15:31 UTC (rev 21049)
@@ -0,0 +1,29 @@
+--- ../modsecurity-2.9.1-RC1/configure.orig	2016-02-07 12:45:53.346098000 -0500
++++ ../modsecurity-2.9.1-RC1/configure	2016-02-07 12:47:50.081558000 -0500
+@@ -14949,7 +14949,7 @@
+ LUA_LDADD=""
+ LUA_LDFLAGS=""
+ LUA_CONFIG=${PKG_CONFIG}
+-LUA_PKGNAMES="lua5.1 lua-5.1 lua_5.1 lua-51 lua_51 lua51 lua5 lua lua5.2 lua-5.2 lua_5.2 lua-52 lua_52 lua52 lua5.3 lua-5.3 lua_5.3 lua-53 lua_53 lua53 "
++LUA_PKGNAMES="luajit "
+ LUA_SONAMES="so la sl dll dylib a"
+ 
+ 
+@@ -14965,7 +14965,7 @@
+   no) :
+     test_paths= ;; #(
+   yes) :
+-    test_paths="/usr/local/liblua /usr/local/lua /usr/local /opt/liblua /opt/lua /opt /usr" ;; #(
++    test_paths="%%PREFIX%%/include/luajit-2.0" ;; #(
+   *) :
+     test_paths="${with_lua}" ;;
+ esac
+@@ -15019,7 +15019,7 @@
+     LUA_LDADD="`${LUA_CONFIG} ${LUA_PKGNAME} --libs-only-l`"
+     if test "$verbose_output" -eq 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: lua LDADD: $LUA_LDADD" >&5
+ $as_echo "$as_me: lua LDADD: $LUA_LDADD" >&6;}; fi
+-    LUA_LDFLAGS="`${LUA_CONFIG} ${LUA_PKGNAME} --libs-only-L --libs-only-other`"
++    LUA_LDFLAGS="`${LUA_CONFIG} ${LUA_PKGNAME} --libs-only-L --libs-only-other | sed 's/\/lua51//'`"
+     if test "$verbose_output" -eq 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: lua LDFLAGS: $LUA_LDFLAGS" >&5
+ $as_echo "$as_me: lua LDFLAGS: $LUA_LDFLAGS" >&6;}; fi
+ else


Property changes on: trunk/www/nginx/files/extra-patch-nginx-modsecurity-configure
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/www/nginx/files/extra-patch-ngx_http_auth_digest_module.c
===================================================================
--- trunk/www/nginx/files/extra-patch-ngx_http_auth_digest_module.c	                        (rev 0)
+++ trunk/www/nginx/files/extra-patch-ngx_http_auth_digest_module.c	2016-03-04 23:15:31 UTC (rev 21049)
@@ -0,0 +1,30 @@
+--- ../nginx-http-auth-digest-bd1c86a/ngx_http_auth_digest_module.c.orig	2011-12-29 04:00:32.000000000 +0400
++++ ../nginx-http-auth-digest-bd1c86a/ngx_http_auth_digest_module.c	2015-06-13 20:18:59.856347000 +0300
+@@ -403,11 +403,11 @@
+   if (http_method.data==NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR;
+   p = ngx_cpymem(http_method.data, r->method_name.data, r->method_end - r->method_name.data+1);
+   
+-  ha2_key.len = http_method.len + r->uri.len + 1;
++  ha2_key.len = http_method.len + r->unparsed_uri.len + 1;
+   ha2_key.data = ngx_pcalloc(r->pool, ha2_key.len);
+   if (ha2_key.data==NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR;
+   p = ngx_cpymem(ha2_key.data, http_method.data, http_method.len-1); *p++ = ':';
+-  p = ngx_cpymem(p, r->uri.data, r->uri.len);
++  p = ngx_cpymem(p, r->unparsed_uri.data, r->unparsed_uri.len);
+ 
+   HA2.len = 33;
+   HA2.data = ngx_pcalloc(r->pool, HA2.len);
+@@ -487,11 +487,11 @@
+     // recalculate the digest with a modified HA2 value (for rspauth) and emit the
+     // Authentication-Info header    
+     ngx_memset(ha2_key.data, 0, ha2_key.len);
+-    p = ngx_sprintf(ha2_key.data, ":%s", r->uri.data);
++    p = ngx_sprintf(ha2_key.data, ":%s", r->unparsed_uri.data);
+ 
+     ngx_memset(HA2.data, 0, HA2.len);
+     ngx_md5_init(&md5);
+-    ngx_md5_update(&md5, ha2_key.data, r->uri.len);
++    ngx_md5_update(&md5, ha2_key.data, r->unparsed_uri.len);
+     ngx_md5_final(hash, &md5);  
+     ngx_hex_dump(HA2.data, hash, 16);
+ 


Property changes on: trunk/www/nginx/files/extra-patch-ngx_http_auth_digest_module.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/www/nginx/files/extra-patch-ngx_http_mogilefs_module.c
===================================================================
--- trunk/www/nginx/files/extra-patch-ngx_http_mogilefs_module.c	                        (rev 0)
+++ trunk/www/nginx/files/extra-patch-ngx_http_mogilefs_module.c	2016-03-04 23:15:31 UTC (rev 21049)
@@ -0,0 +1,12 @@
+--- ../nginx_mogilefs_module-1.0.4/ngx_http_mogilefs_module.c.orig	2015-04-21 21:16:22.251692000 +0300
++++ ../nginx_mogilefs_module-1.0.4/ngx_http_mogilefs_module.c	2015-04-21 21:16:39.460724000 +0300
+@@ -316,9 +316,6 @@
+ 
+     u->peer.log = r->connection->log;
+     u->peer.log_error = NGX_ERROR_ERR;
+-#if (NGX_THREADS)
+-    u->peer.lock = &r->connection->lock;
+-#endif
+ 
+     u->output.tag = (ngx_buf_tag_t) &ngx_http_mogilefs_module;
+ 


Property changes on: trunk/www/nginx/files/extra-patch-ngx_http_mogilefs_module.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/www/nginx/files/extra-patch-ngx_http_notice_module.c
===================================================================
--- trunk/www/nginx/files/extra-patch-ngx_http_notice_module.c	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/extra-patch-ngx_http_notice_module.c	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,5 +1,5 @@
---- ../kr-nginx-notice-3c95966/ngx_http_notice_module.c.orig	2009-07-16 18:37:57.000000000 +0200
-+++ ../kr-nginx-notice-3c95966/ngx_http_notice_module.c	2009-07-16 08:09:38.000000000 +0200
+--- ../nginx-notice-3c95966/ngx_http_notice_module.c.orig	2009-07-16 18:37:57.000000000 +0200
++++ ../nginx-notice-3c95966/ngx_http_notice_module.c	2009-07-16 08:09:38.000000000 +0200
 @@ -153,7 +153,7 @@
          return NGX_HTTP_NOT_ALLOWED;
      }

Added: trunk/www/nginx/files/extra-patch-ngx_http_sflow_module.c
===================================================================
--- trunk/www/nginx/files/extra-patch-ngx_http_sflow_module.c	                        (rev 0)
+++ trunk/www/nginx/files/extra-patch-ngx_http_sflow_module.c	2016-03-04 23:15:31 UTC (rev 21049)
@@ -0,0 +1,60 @@
+--- ../nginx-sflow-module-0.9.7/ngx_http_sflow_module.c.orig	2015-04-21 21:21:17.020547000 +0300
++++ ../nginx-sflow-module-0.9.7/ngx_http_sflow_module.c	2015-04-21 21:22:26.994714000 +0300
+@@ -8,10 +8,6 @@
+ #include <ngx_http.h>
+ #include <nginx.h>
+ 
+-#if (NGX_THREADS)
+-#include <ngx_thread.h>
+-#endif
+-
+ #include "ngx_http_sflow_api.h"
+ #include "ngx_http_sflow_config.h"
+ 
+@@ -42,18 +38,10 @@
+     /* keep log ptr for callbacks */
+     ngx_log_t *log;
+ 
+-#if (NGX_THREADS)
+-    ngx_mutex_t *mut;
+-#define SFWB_LOCK(_s) ngx_mutex_lock((_s)->mut)
+-#define SFWB_UNLOCK(_s) ngx_mutex_unlock((_s)->mut)
+-#define SFWB_INC_CTR(_c) ngx_atomic_fetch_add(&(_c), 1)
+-#define SFWB_COUNTDOWN(_c) (ngx_atomic_fetch_add(&(_c), -1) == 1)
+-#else
+ #define SFWB_LOCK(_s) /* no-op */
+ #define SFWB_UNLOCK(_s) /* no-op */
+ #define SFWB_INC_CTR(_c) (_c)++
+ #define SFWB_COUNTDOWN(_c) (--(_c) == 0)
+-#endif
+ 
+     /* delegate acquiring the sflow config */
+     SFWBConfigManager *config_manager;
+@@ -411,13 +399,8 @@
+ static int32_t ngx_http_sflow_add_random_skip(SFWB *sm)
+ {
+     ngx_atomic_t next_skip = sfl_sampler_next_skip(sm->sampler);
+-#if (NGX_THREADS)
+-    ngx_atomic_int_t test_skip = ngx_atomic_fetch_add(&sm->sflow_skip, next_skip);
+-    return (test_skip + next_skip);
+-#else
+     sm->sflow_skip = next_skip;
+     return next_skip;
+-#endif
+ }
+ 
+ /*_________________---------------------------__________________
+@@ -528,13 +511,6 @@
+     /* a pool to use for the agent so we can recycle the memory easily on a config change */
+     sm->masterPool = ngx_create_pool(SFWB_POOL_SIZ, cf->log);
+ 
+-#if (NGX_THREADS)
+-    /* a mutex to lock the sFlow agent when taking a sample (only needed if there
+-       is more that one worker thread - right now it seems like threads are not even
+-       an option in the configure script) */
+-    sm->mut = ngx_mutex_init(cf->log, 0);
+-#endif
+-
+     /* create and initialze the config_manager */
+     sm->config_manager = ngx_pcalloc(cf->pool, sizeof(SFWBConfigManager));
+     sfwb_config_init(sm->config_manager, cf->log);


Property changes on: trunk/www/nginx/files/extra-patch-ngx_http_sflow_module.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/www/nginx/files/extra-patch-ngx_http_tarantool-config
===================================================================
--- trunk/www/nginx/files/extra-patch-ngx_http_tarantool-config	                        (rev 0)
+++ trunk/www/nginx/files/extra-patch-ngx_http_tarantool-config	2016-03-04 23:15:31 UTC (rev 21049)
@@ -0,0 +1,11 @@
+--- ../nginx_upstream_module-966f2f5/config.orig	2015-08-20 23:33:02.000000000 +0300
++++ ../nginx_upstream_module-966f2f5/config	2015-08-23 16:04:59.572045669 +0300
+@@ -4,7 +4,7 @@
+           "
+ 
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs \
+-           $ngx_addon_dir/third_party/yajl/build/yajl-2.1.0/lib/libyajl_s.a \
++           %%PREFIX%%/lib/libyajl_s.a \
+            "
+ 
+ HTTP_MODULES="$HTTP_MODULES               \


Property changes on: trunk/www/nginx/files/extra-patch-ngx_http_tarantool-config
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Deleted: trunk/www/nginx/files/extra-patch-ngx_http_upload_module.c
===================================================================
--- trunk/www/nginx/files/extra-patch-ngx_http_upload_module.c	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/extra-patch-ngx_http_upload_module.c	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,1658 +0,0 @@
---- ../nginx_upload_module-2.2.0/ngx_http_upload_module.c.orig	2010-09-27 21:54:15.000000000 +0300
-+++ ../nginx_upload_module-2.2.0/ngx_http_upload_module.c	2013-09-10 17:40:59.570815847 +0300
-@@ -50,7 +50,7 @@
-  * State of multipart/form-data parser
-  */
- typedef enum {
--	upload_state_boundary_seek,
-+  upload_state_boundary_seek,
- 	upload_state_after_boundary,
- 	upload_state_headers,
- 	upload_state_data,
-@@ -95,6 +95,14 @@
- } ngx_http_upload_field_template_t;
- 
- /*
-+ * Template for a header
-+ */
-+typedef struct {
-+    ngx_http_complex_value_t      *name;
-+    ngx_http_complex_value_t      *value;
-+} ngx_http_upload_header_template_t;
-+
-+/*
-  * Filter for fields in output form
-  */
- typedef struct {
-@@ -106,6 +114,12 @@
- #endif
- } ngx_http_upload_field_filter_t;
- 
-+typedef struct {
-+    ngx_path_t                  *path;
-+    ngx_http_complex_value_t    dynamic;
-+    unsigned                    is_dynamic:1;
-+} ngx_http_upload_path_t;
-+
- /*
-  * Upload cleanup record
-  */
-@@ -124,8 +138,8 @@
- typedef struct {
-     ngx_str_t                     url;
-     ngx_http_complex_value_t      *url_cv;
--    ngx_path_t                    *state_store_path;
--    ngx_path_t                    *store_path;
-+    ngx_http_upload_path_t        *state_store_path;
-+    ngx_http_upload_path_t        *store_path;
-     ngx_uint_t                    store_access;
-     size_t                        buffer_size;
-     size_t                        merge_buffer_size;
-@@ -137,13 +151,17 @@
-     ngx_array_t                   *aggregate_field_templates;
-     ngx_array_t                   *field_filters;
-     ngx_array_t                   *cleanup_statuses;
-+    ngx_array_t                   *header_templates;
-     ngx_flag_t                    forward_args;
-     ngx_flag_t                    tame_arrays;
-     ngx_flag_t                    resumable_uploads;
-+    ngx_flag_t                    empty_field_names;
-     size_t                        limit_rate;
- 
-     unsigned int                  md5:1;
-     unsigned int                  sha1:1;
-+    unsigned int                  sha256:1;
-+    unsigned int                  sha512:1;
-     unsigned int                  crc32:1;
- } ngx_http_upload_loc_conf_t;
- 
-@@ -157,6 +175,16 @@
-     u_char      sha1_digest[SHA_DIGEST_LENGTH * 2];
- } ngx_http_upload_sha1_ctx_t;
- 
-+typedef struct ngx_http_upload_sha256_ctx_s {
-+    SHA256_CTX  sha256;
-+    u_char      sha256_digest[SHA256_DIGEST_LENGTH * 2];
-+} ngx_http_upload_sha256_ctx_t;
-+
-+typedef struct ngx_http_upload_sha512_ctx_s {
-+    SHA512_CTX  sha512;
-+    u_char      sha512_digest[SHA512_DIGEST_LENGTH * 2];
-+} ngx_http_upload_sha512_ctx_t;
-+
- struct ngx_http_upload_ctx_s;
- 
- /*
-@@ -219,7 +247,11 @@
- 
-     ngx_http_upload_md5_ctx_t   *md5_ctx;    
-     ngx_http_upload_sha1_ctx_t  *sha1_ctx;    
-+    ngx_http_upload_sha256_ctx_t *sha256_ctx;
-+    ngx_http_upload_sha512_ctx_t *sha512_ctx;
-     uint32_t                    crc32;    
-+    ngx_path_t          *store_path;
-+    ngx_path_t          *state_store_path;
- 
-     unsigned int        first_part:1;
-     unsigned int        discard_data:1;
-@@ -233,7 +265,21 @@
-     unsigned int        raw_input:1;
- } ngx_http_upload_ctx_t;
- 
-+static ngx_int_t ngx_http_upload_test_expect(ngx_http_request_t *r);
-+
-+static void ngx_http_read_client_request_body_handler(ngx_http_request_t *r);
-+static ngx_int_t ngx_http_do_read_client_request_body(ngx_http_request_t *r);
-+
-+static ngx_int_t ngx_http_write_request_body(ngx_http_request_t *r);
-+static ngx_int_t ngx_http_request_body_filter(ngx_http_request_t *r, ngx_chain_t *in);
-+
-+static ngx_int_t ngx_http_request_body_length_filter(ngx_http_request_t *r, ngx_chain_t *in);
-+static ngx_int_t ngx_http_request_body_chunked_filter(ngx_http_request_t *r, ngx_chain_t *in);
-+
-+static ngx_int_t ngx_http_request_body_save_filter(ngx_http_request_t *r, ngx_chain_t *in);
-+
- static ngx_int_t ngx_http_upload_handler(ngx_http_request_t *r);
-+static ngx_int_t ngx_http_upload_options_handler(ngx_http_request_t *r);
- static ngx_int_t ngx_http_upload_body_handler(ngx_http_request_t *r);
- 
- static void *ngx_http_upload_create_loc_conf(ngx_conf_t *cf);
-@@ -248,6 +294,10 @@
-     ngx_http_variable_value_t *v, uintptr_t data);
- static ngx_int_t ngx_http_upload_sha1_variable(ngx_http_request_t *r,
-     ngx_http_variable_value_t *v, uintptr_t data);
-+static ngx_int_t ngx_http_upload_sha256_variable(ngx_http_request_t *r,
-+    ngx_http_variable_value_t *v, uintptr_t data);
-+static ngx_int_t ngx_http_upload_sha512_variable(ngx_http_request_t *r,
-+    ngx_http_variable_value_t *v, uintptr_t data);
- static ngx_int_t ngx_http_upload_file_size_variable(ngx_http_request_t *r,
-     ngx_http_variable_value_t *v, uintptr_t data);
- static void ngx_http_upload_content_range_variable_set(ngx_http_request_t *r,
-@@ -271,6 +321,7 @@
- static ngx_int_t ngx_http_upload_merge_ranges(ngx_http_upload_ctx_t *u, ngx_http_upload_range_t *range_n);
- static ngx_int_t ngx_http_upload_parse_range(ngx_str_t *range, ngx_http_upload_range_t *range_n);
- 
-+
- static void ngx_http_read_upload_client_request_body_handler(ngx_http_request_t *r);
- static ngx_int_t ngx_http_do_read_upload_client_request_body(ngx_http_request_t *r);
- static ngx_int_t ngx_http_process_request_body(ngx_http_request_t *r, ngx_chain_t *body);
-@@ -279,8 +330,16 @@
- 
- static char *ngx_http_upload_set_form_field(ngx_conf_t *cf, ngx_command_t *cmd,
-     void *conf);
-+static char *ngx_http_upload_add_header(ngx_conf_t *cf, ngx_command_t *cmd,
-+    void *conf);
-+static ngx_int_t ngx_http_upload_eval_path(ngx_http_request_t *r);
-+static ngx_int_t ngx_http_upload_eval_state_path(ngx_http_request_t *r);
- static char *ngx_http_upload_pass_form_field(ngx_conf_t *cf, ngx_command_t *cmd,
-     void *conf);
-+static char *ngx_http_upload_set_path_slot(ngx_conf_t *cf, ngx_command_t *cmd,
-+    void *conf);
-+static char *ngx_http_upload_merge_path_value(ngx_conf_t *cf, ngx_http_upload_path_t **path, ngx_http_upload_path_t *prev,
-+    ngx_path_init_t *init);
- static char *ngx_http_upload_cleanup(ngx_conf_t *cf, ngx_command_t *cmd,
-     void *conf);
- static void ngx_upload_cleanup_handler(void *data);
-@@ -391,7 +450,7 @@
-     { ngx_string("upload_store"),
-       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF|NGX_HTTP_LIF_CONF
-                         |NGX_CONF_TAKE1234,
--      ngx_conf_set_path_slot,
-+      ngx_http_upload_set_path_slot,
-       NGX_HTTP_LOC_CONF_OFFSET,
-       offsetof(ngx_http_upload_loc_conf_t, store_path),
-       NULL },
-@@ -401,7 +460,7 @@
-      */
-     { ngx_string("upload_state_store"),
-       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
--      ngx_conf_set_path_slot,
-+      ngx_http_upload_set_path_slot,
-       NGX_HTTP_LOC_CONF_OFFSET,
-       offsetof(ngx_http_upload_loc_conf_t, state_store_path),
-       NULL },
-@@ -575,6 +634,28 @@
-        offsetof(ngx_http_upload_loc_conf_t, resumable_uploads),
-        NULL },
- 
-+     /*
-+      * Specifies whether empty field names are allowed
-+      */
-+     { ngx_string("upload_empty_fiels_names"),
-+       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF|NGX_HTTP_LIF_CONF
-+                         |NGX_CONF_FLAG,
-+       ngx_conf_set_flag_slot,
-+       NGX_HTTP_LOC_CONF_OFFSET,
-+       offsetof(ngx_http_upload_loc_conf_t, empty_field_names),
-+       NULL },
-+
-+    /*
-+     * Specifies the name and content of the header that will be added to the response
-+     */
-+    { ngx_string("upload_add_header"),
-+      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF|NGX_HTTP_LIF_CONF
-+                        |NGX_CONF_TAKE2,
-+      ngx_http_upload_add_header,
-+      NGX_HTTP_LOC_CONF_OFFSET,
-+      offsetof(ngx_http_upload_loc_conf_t, header_templates),
-+      NULL},
-+
-       ngx_null_command
- }; /* }}} */
- 
-@@ -658,6 +739,22 @@
-       (uintptr_t) "0123456789ABCDEF",
-       NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
- 
-+    { ngx_string("upload_file_sha256"), NULL, ngx_http_upload_sha256_variable,
-+      (uintptr_t) "0123456789abcdef",
-+      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-+
-+    { ngx_string("upload_file_sha256_uc"), NULL, ngx_http_upload_sha256_variable,
-+      (uintptr_t) "0123456789ABCDEF",
-+      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-+
-+    { ngx_string("upload_file_sha512"), NULL, ngx_http_upload_sha512_variable,
-+      (uintptr_t) "0123456789abcdef",
-+      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-+
-+    { ngx_string("upload_file_sha512_uc"), NULL, ngx_http_upload_sha512_variable,
-+      (uintptr_t) "0123456789ABCDEF",
-+      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-+
-     { ngx_string("upload_file_crc32"), NULL, ngx_http_upload_crc32_variable,
-       (uintptr_t) offsetof(ngx_http_upload_ctx_t, crc32),
-       NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-@@ -688,6 +785,9 @@
-     ngx_http_upload_ctx_t     *u;
-     ngx_int_t                 rc;
- 
-+    if(r->method & NGX_HTTP_OPTIONS)
-+        return ngx_http_upload_options_handler(r);
-+
-     if (!(r->method & NGX_HTTP_POST))
-         return NGX_HTTP_NOT_ALLOWED;
- 
-@@ -724,6 +824,26 @@
-     }else
-         u->sha1_ctx = NULL;
- 
-+    if(ulcf->sha256) {
-+        if(u->sha256_ctx == NULL) {
-+            u->sha256_ctx = ngx_palloc(r->pool, sizeof(ngx_http_upload_sha256_ctx_t));
-+            if (u->sha256_ctx == NULL) {
-+                return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+            }
-+        }
-+    }else
-+        u->sha256_ctx = NULL;
-+
-+    if(ulcf->sha512) {
-+        if(u->sha512_ctx == NULL) {
-+            u->sha512_ctx = ngx_palloc(r->pool, sizeof(ngx_http_upload_sha512_ctx_t));
-+            if (u->sha512_ctx == NULL) {
-+                return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+            }
-+        }
-+    }else
-+        u->sha512_ctx = NULL;
-+
-     u->calculate_crc32 = ulcf->crc32;
- 
-     u->request = r;
-@@ -746,6 +866,25 @@
-         return rc;
-     }
- 
-+    rc = ngx_http_upload_eval_path(r);
-+
-+    if(rc != NGX_OK) {
-+        upload_shutdown_ctx(u);
-+        return rc;
-+    }
-+
-+    rc = ngx_http_upload_eval_state_path(r);
-+
-+    if(rc != NGX_OK) {
-+        upload_shutdown_ctx(u);
-+        return rc;
-+    }
-+
-+    if (ngx_http_upload_test_expect(r) != NGX_OK) {
-+        upload_shutdown_ctx(u);
-+        return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+    }
-+
-     if(upload_start(u, ulcf) != NGX_OK)
-         return NGX_HTTP_INTERNAL_SERVER_ERROR;
- 
-@@ -758,6 +897,124 @@
-     return NGX_DONE;
- } /* }}} */
- 
-+static ngx_int_t ngx_http_upload_add_headers(ngx_http_request_t *r, ngx_http_upload_loc_conf_t *ulcf) { /* {{{ */
-+    ngx_str_t                            name;
-+    ngx_str_t                            value;
-+    ngx_http_upload_header_template_t    *t;
-+    ngx_table_elt_t                      *h;
-+    ngx_uint_t                           i;
-+
-+    if(ulcf->header_templates != NULL) {
-+        t = ulcf->header_templates->elts;
-+        for(i = 0; i < ulcf->header_templates->nelts; i++) {
-+            if(ngx_http_complex_value(r, t->name, &name) != NGX_OK) {
-+                return NGX_ERROR;
-+            }
-+
-+            if(ngx_http_complex_value(r, t->value, &value) != NGX_OK) {
-+                return NGX_ERROR;
-+            }
-+
-+            if(name.len != 0 && value.len != 0) {
-+                h = ngx_list_push(&r->headers_out.headers);
-+                if(h == NULL) {
-+                    return NGX_ERROR;
-+                }
-+
-+                h->hash = 1;
-+                h->key.len = name.len;
-+                h->key.data = name.data;
-+                h->value.len = value.len;
-+                h->value.data = value.data;
-+            }
-+
-+            t++;
-+        }
-+    }
-+
-+    return NGX_OK;
-+} /* }}} */
-+
-+static ngx_int_t /* {{{  */
-+ngx_http_upload_eval_path(ngx_http_request_t *r) {
-+    ngx_http_upload_ctx_t       *u;
-+    ngx_http_upload_loc_conf_t  *ulcf;
-+    ngx_str_t                   value;
-+
-+    ulcf = ngx_http_get_module_loc_conf(r, ngx_http_upload_module);
-+    u = ngx_http_get_module_ctx(r, ngx_http_upload_module);
-+
-+    if(ulcf->store_path->is_dynamic) {
-+        u->store_path = ngx_pcalloc(r->pool, sizeof(ngx_path_t));
-+        if(u->store_path == NULL) {
-+            return NGX_ERROR;
-+        }
-+
-+        ngx_memcpy(u->store_path, ulcf->store_path->path, sizeof(ngx_path_t));
-+
-+        if(ngx_http_complex_value(r, &ulcf->store_path->dynamic, &value) != NGX_OK) {
-+            return NGX_ERROR;
-+        }
-+
-+        u->store_path->name.data = value.data;
-+        u->store_path->name.len = value.len;
-+    }
-+    else{
-+        u->store_path = ulcf->store_path->path;
-+    }
-+
-+    return NGX_OK;
-+} /* }}} */
-+
-+static ngx_int_t /* {{{  */
-+ngx_http_upload_eval_state_path(ngx_http_request_t *r) {
-+    ngx_http_upload_ctx_t       *u;
-+    ngx_http_upload_loc_conf_t  *ulcf;
-+    ngx_str_t                   value;
-+
-+    ulcf = ngx_http_get_module_loc_conf(r, ngx_http_upload_module);
-+    u = ngx_http_get_module_ctx(r, ngx_http_upload_module);
-+
-+    if(ulcf->state_store_path->is_dynamic) {
-+        u->state_store_path = ngx_pcalloc(r->pool, sizeof(ngx_path_t));
-+        if(u->store_path == NULL) {
-+            return NGX_ERROR;
-+        }
-+
-+        ngx_memcpy(u->state_store_path, ulcf->state_store_path->path, sizeof(ngx_path_t));
-+
-+        if(ngx_http_complex_value(r, &ulcf->state_store_path->dynamic, &value) != NGX_OK) {
-+            return NGX_ERROR;
-+        }
-+
-+        u->state_store_path->name.data = value.data;
-+        u->state_store_path->name.len = value.len;
-+    }
-+    else{
-+        u->state_store_path = ulcf->state_store_path->path;
-+    }
-+
-+    return NGX_OK;
-+} /* }}} */
-+
-+static ngx_int_t ngx_http_upload_options_handler(ngx_http_request_t *r) { /* {{{ */
-+    ngx_http_upload_loc_conf_t *ulcf;
-+
-+    ulcf = ngx_http_get_module_loc_conf(r, ngx_http_upload_module);
-+
-+    r->headers_out.status = NGX_HTTP_OK;
-+
-+    if(ngx_http_upload_add_headers(r, ulcf) != NGX_OK) {
-+        return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+    }
-+
-+    r->header_only = 1;
-+    r->headers_out.content_length_n = 0;
-+    r->allow_ranges = 0;
-+
-+    return ngx_http_send_header(r);
-+} /* }}} */
-+
- static ngx_int_t ngx_http_upload_body_handler(ngx_http_request_t *r) { /* {{{ */
-     ngx_http_upload_loc_conf_t  *ulcf = ngx_http_get_module_loc_conf(r, ngx_http_upload_module);
-     ngx_http_upload_ctx_t       *ctx = ngx_http_get_module_ctx(r, ngx_http_upload_module);
-@@ -771,6 +1028,10 @@
-     ngx_str_t                   dummy = ngx_string("<ngx_upload_module_dummy>");
-     ngx_table_elt_t             *h;
- 
-+    if(ngx_http_upload_add_headers(r, ulcf) != NGX_OK) {
-+        return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+    }
-+
-     if(ctx->prevent_output) {
-         r->headers_out.status = NGX_HTTP_CREATED;
- 
-@@ -952,7 +1213,8 @@
-     ngx_http_upload_loc_conf_t  *ulcf = ngx_http_get_module_loc_conf(r, ngx_http_upload_module);
- 
-     ngx_file_t  *file = &u->output_file;
--    ngx_path_t  *path = ulcf->store_path;
-+    ngx_path_t  *path = u->store_path;
-+    ngx_path_t  *state_path = u->state_store_path;
-     uint32_t    n;
-     ngx_uint_t  i;
-     ngx_int_t   rc;
-@@ -992,6 +1254,7 @@
-                            "hashed path: %s", file->name.data);
- 
-             if(u->partial_content) {
-+                ngx_file_t *state_file = &u->state_file;
-                 if(u->merge_buffer == NULL) {
-                     u->merge_buffer = ngx_palloc(r->pool, ulcf->merge_buffer_size);
- 
-@@ -999,21 +1262,20 @@
-                         return NGX_UPLOAD_NOMEM;
-                 }
- 
--                u->state_file.name.len = file->name.len + sizeof(".state") - 1;
--                u->state_file.name.data = ngx_palloc(u->request->pool, u->state_file.name.len + 1);
-+                state_file->name.len = state_path->name.len + 1 + state_path->len + u->session_id.len + sizeof(".state");
-+                state_file->name.data = ngx_palloc(u->request->pool, state_file->name.len + 1);
- 
--                if(u->state_file.name.data == NULL)
-+                if(state_file->name.data == NULL)
-                     return NGX_UPLOAD_NOMEM;
- 
--                ngx_memcpy(u->state_file.name.data, file->name.data, file->name.len);
-+                ngx_memcpy(state_file->name.data, state_path->name.data, state_path->name.len);
-+                (void) ngx_sprintf(state_file->name.data + state_path->name.len + 1 + state_path->len,
-+                        "%V.state%Z", &u->session_id);
- 
--                /*
--                 * NOTE: we add terminating zero for system calls
--                 */
--                ngx_memcpy(u->state_file.name.data + file->name.len, ".state", sizeof(".state") - 1 + 1);
-+                ngx_create_hashed_filename(state_path, state_file->name.data, state_file->name.len);
- 
-                 ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0,
--                               "hashed path of state file: %s", u->state_file.name.data);
-+                               "hashed path of state file: %s", state_file->name.data);
-             }
- 
-             file->fd = ngx_open_file(file->name.data, NGX_FILE_WRONLY, NGX_FILE_CREATE_OR_OPEN, ulcf->store_access);
-@@ -1117,6 +1379,12 @@
-         if(u->sha1_ctx != NULL)
-             SHA1_Init(&u->sha1_ctx->sha1);
- 
-+        if(u->sha256_ctx != NULL)
-+            SHA256_Init(&u->sha256_ctx->sha256);
-+
-+        if(u->sha512_ctx != NULL)
-+            SHA512_Init(&u->sha512_ctx->sha512);
-+
-         if(u->calculate_crc32)
-             ngx_crc32_init(u->crc32);
- 
-@@ -1150,7 +1418,10 @@
- #if (NGX_PCRE)
-                 rc = ngx_regex_exec(f[i].regex, &u->field_name, NULL, 0);
- 
--                if (rc != NGX_REGEX_NO_MATCHED && rc < 0) {
-+                /* Modified by Naren to work around iMovie and Quicktime which send empty values Added:  &&  u->field_name.len > 0 */
-+                if ((ulcf->empty_field_names && rc != NGX_REGEX_NO_MATCHED && rc < 0 && u->field_name.len != 0)
-+                    || (!ulcf->empty_field_names && rc != NGX_REGEX_NO_MATCHED && rc < 0))
-+                {
-                     return NGX_UPLOAD_SCRIPTERROR;
-                 }
- 
-@@ -1166,7 +1437,7 @@
-             }
-         }
- 
--        if(pass_field && u->field_name.len > 0) { 
-+        if(pass_field && u->field_name.len != 0) { 
-             /*
-              * Here we do a small hack: the content of a non-file field
-              * is not known until ngx_http_upload_flush_output_buffer
-@@ -1207,6 +1478,12 @@
-         if(u->sha1_ctx)
-             SHA1_Final(u->sha1_ctx->sha1_digest, &u->sha1_ctx->sha1);
- 
-+        if(u->sha256_ctx)
-+            SHA256_Final(u->sha256_ctx->sha256_digest, &u->sha256_ctx->sha256);
-+
-+        if(u->sha512_ctx)
-+            SHA512_Final(u->sha512_ctx->sha512_digest, &u->sha512_ctx->sha512);
-+
-         if(u->calculate_crc32)
-             ngx_crc32_final(u->crc32);
- 
-@@ -1369,6 +1646,12 @@
-         if(u->sha1_ctx)
-             SHA1_Update(&u->sha1_ctx->sha1, buf, len);
- 
-+        if(u->sha256_ctx)
-+            SHA256_Update(&u->sha256_ctx->sha256, buf, len);
-+
-+        if(u->sha512_ctx)
-+            SHA512_Update(&u->sha512_ctx->sha512, buf, len);
-+
-         if(u->calculate_crc32)
-             ngx_crc32_update(&u->crc32, buf, len);
- 
-@@ -1678,7 +1961,7 @@
-     ngx_http_upload_merger_state_t ms;
-     off_t        remaining;
-     ssize_t      rc;
--    int          result;
-+    __attribute__((__unused__)) int result;
-     ngx_buf_t    in_buf;
-     ngx_buf_t    out_buf;
-     ngx_http_upload_loc_conf_t  *ulcf = ngx_http_get_module_loc_conf(u->request, ngx_http_upload_module);
-@@ -1799,6 +2082,7 @@
-     conf->forward_args = NGX_CONF_UNSET;
-     conf->tame_arrays = NGX_CONF_UNSET;
-     conf->resumable_uploads = NGX_CONF_UNSET;
-+    conf->empty_field_names = NGX_CONF_UNSET;
- 
-     conf->buffer_size = NGX_CONF_UNSET_SIZE;
-     conf->merge_buffer_size = NGX_CONF_UNSET_SIZE;
-@@ -1809,6 +2093,7 @@
-     conf->limit_rate = NGX_CONF_UNSET_SIZE;
- 
-     /*
-+     * conf->header_templates,
-      * conf->field_templates,
-      * conf->aggregate_field_templates,
-      * and conf->field_filters are
-@@ -1830,27 +2115,15 @@
-     }
- 
-     if(conf->url.len != 0) {
--#if defined nginx_version && nginx_version >= 7052
--        ngx_conf_merge_path_value(cf,
-+        ngx_http_upload_merge_path_value(cf,
-                                   &conf->store_path,
-                                   prev->store_path,
-                                   &ngx_http_upload_temp_path);
- 
--        ngx_conf_merge_path_value(cf,
-+        ngx_http_upload_merge_path_value(cf,
-                                   &conf->state_store_path,
-                                   prev->state_store_path,
-                                   &ngx_http_upload_temp_path);
--#else
--        ngx_conf_merge_path_value(conf->store_path,
--                                  prev->store_path,
--                                  NGX_HTTP_PROXY_TEMP_PATH, 1, 2, 0,
--                                  ngx_garbage_collector_temp_handler, cf);
--
--        ngx_conf_merge_path_value(conf->state_store_path,
--                                  prev->state_store_path,
--                                  NGX_HTTP_PROXY_TEMP_PATH, 1, 2, 0,
--                                  ngx_garbage_collector_temp_handler, cf);
--#endif
-     }
- 
-     ngx_conf_merge_uint_value(conf->store_access,
-@@ -1897,6 +2170,11 @@
-             prev->resumable_uploads : 0;
-     }
- 
-+    if(conf->empty_field_names == NGX_CONF_UNSET) {
-+        conf->empty_field_names = (prev->empty_field_names != NGX_CONF_UNSET) ?
-+            prev->empty_field_names : 0;
-+    }
-+
-     if(conf->field_templates == NULL) {
-         conf->field_templates = prev->field_templates;
-     }
-@@ -1912,6 +2190,14 @@
-             conf->sha1 = prev->sha1;
-         }
- 
-+        if(prev->sha256) {
-+            conf->sha256 = prev->sha256;
-+        }
-+
-+        if(prev->sha512) {
-+            conf->sha512 = prev->sha512;
-+        }
-+
-         if(prev->crc32) {
-             conf->crc32 = prev->crc32;
-         }
-@@ -1925,6 +2211,10 @@
-         conf->cleanup_statuses = prev->cleanup_statuses;
-     }
- 
-+    if(conf->header_templates == NULL) {
-+        conf->header_templates = prev->header_templates;
-+    }
-+
-     return NGX_CONF_OK;
- } /* }}} */
- 
-@@ -2066,6 +2356,80 @@
-     return NGX_OK;
- } /* }}} */
- 
-+static ngx_int_t /* {{{ ngx_http_upload_sha256_variable */
-+ngx_http_upload_sha256_variable(ngx_http_request_t *r,
-+    ngx_http_variable_value_t *v,  uintptr_t data)
-+{
-+    ngx_uint_t             i;
-+    ngx_http_upload_ctx_t  *u;
-+    u_char                 *c;
-+    u_char                 *hex_table;
-+
-+    u = ngx_http_get_module_ctx(r, ngx_http_upload_module);
-+
-+    if(u->sha256_ctx == NULL || u->partial_content) {
-+        v->not_found = 1;
-+        return NGX_OK;
-+    }
-+
-+    v->valid = 1;
-+    v->no_cacheable = 0;
-+    v->not_found = 0;
-+
-+    hex_table = (u_char*)data;
-+    c = u->sha256_ctx->sha256_digest + SHA256_DIGEST_LENGTH * 2;
-+
-+    i = SHA256_DIGEST_LENGTH;
-+
-+    do{
-+        i--;
-+        *--c = hex_table[u->sha256_ctx->sha256_digest[i] & 0xf];
-+        *--c = hex_table[u->sha256_ctx->sha256_digest[i] >> 4];
-+    }while(i != 0);
-+
-+    v->data = u->sha256_ctx->sha256_digest;
-+    v->len = SHA256_DIGEST_LENGTH * 2;
-+
-+    return NGX_OK;
-+} /* }}} */
-+
-+static ngx_int_t /* {{{ ngx_http_upload_sha512_variable */
-+ngx_http_upload_sha512_variable(ngx_http_request_t *r,
-+    ngx_http_variable_value_t *v,  uintptr_t data)
-+{
-+    ngx_uint_t             i;
-+    ngx_http_upload_ctx_t  *u;
-+    u_char                 *c;
-+    u_char                 *hex_table;
-+
-+    u = ngx_http_get_module_ctx(r, ngx_http_upload_module);
-+
-+    if(u->sha512_ctx == NULL || u->partial_content) {
-+        v->not_found = 1;
-+        return NGX_OK;
-+    }
-+
-+    v->valid = 1;
-+    v->no_cacheable = 0;
-+    v->not_found = 0;
-+
-+    hex_table = (u_char*)data;
-+    c = u->sha512_ctx->sha512_digest + SHA512_DIGEST_LENGTH * 2;
-+
-+    i = SHA512_DIGEST_LENGTH;
-+
-+    do{
-+        i--;
-+        *--c = hex_table[u->sha512_ctx->sha512_digest[i] & 0xf];
-+        *--c = hex_table[u->sha512_ctx->sha512_digest[i] >> 4];
-+    }while(i != 0);
-+
-+    v->data = u->sha512_ctx->sha512_digest;
-+    v->len = SHA512_DIGEST_LENGTH * 2;
-+
-+    return NGX_OK;
-+} /* }}} */
-+
- static ngx_int_t /* {{{ ngx_http_upload_crc32_variable */
- ngx_http_upload_crc32_variable(ngx_http_request_t *r,
-     ngx_http_variable_value_t *v,  uintptr_t data)
-@@ -2299,6 +2663,10 @@
-                                        ", upload_file_md5_uc"
-                                        ", upload_file_sha1"
-                                        ", upload_file_sha1_uc"
-+                                       ", upload_file_sha256"
-+                                       ", upload_file_sha256_uc"
-+                                       ", upload_file_sha512"
-+                                       ", upload_file_sha512_uc"
-                                        ", upload_file_crc32"
-                                        ", upload_content_range"
-                                        " and upload_file_size"
-@@ -2312,6 +2680,12 @@
-                 if(v->get_handler == ngx_http_upload_sha1_variable)
-                     ulcf->sha1 = 1;
- 
-+                if(v->get_handler == ngx_http_upload_sha256_variable)
-+                    ulcf->sha256 = 1;
-+
-+                if(v->get_handler == ngx_http_upload_sha512_variable)
-+                    ulcf->sha512 = 1;
-+
-                 if(v->get_handler == ngx_http_upload_crc32_variable)
-                     ulcf->crc32 = 1;
-             }
-@@ -2396,37 +2770,104 @@
-     return NGX_CONF_OK;
- } /* }}} */
- 
--static char * /* {{{ ngx_http_upload_cleanup */
--ngx_http_upload_cleanup(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-+static char * /* {{{ ngx_http_upload_add_header */
-+ngx_http_upload_add_header(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
- {
--    ngx_http_upload_loc_conf_t *ulcf = conf;
--
-     ngx_str_t                  *value;
--    ngx_uint_t                 i;
--    ngx_int_t                  status, lo, hi;
--    uint16_t                   *s;
-+    ngx_http_upload_header_template_t *h;
-+    ngx_array_t                 **field;
-+    ngx_http_compile_complex_value_t   ccv;
-+
-+    field = (ngx_array_t**) (((u_char*)conf) + cmd->offset);
- 
-     value = cf->args->elts;
- 
--    if (ulcf->cleanup_statuses == NULL) {
--        ulcf->cleanup_statuses = ngx_array_create(cf->pool, 1,
--                                        sizeof(uint16_t));
--        if (ulcf->cleanup_statuses == NULL) {
-+    /*
-+     * Add new entry to header template list
-+     */
-+    if (*field == NULL) {
-+        *field = ngx_array_create(cf->pool, 1,
-+                                  sizeof(ngx_http_upload_header_template_t));
-+        if (*field == NULL) {
-             return NGX_CONF_ERROR;
-         }
-     }
- 
--    for (i = 1; i < cf->args->nelts; i++) {
--        if(value[i].len > 4 && value[i].data[3] == '-') {
--            lo = ngx_atoi(value[i].data, 3);
--
--            if (lo == NGX_ERROR) {
--                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
--                                   "invalid lower bound \"%V\"", &value[i]);
--                return NGX_CONF_ERROR;
--            }
--
--            hi = ngx_atoi(value[i].data + 4, value[i].len - 4);
-+    h = ngx_array_push(*field);
-+    if (h == NULL) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    /*
-+     * Compile header name
-+     */
-+    h->name = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
-+    if(h->name == NULL) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-+
-+    ccv.cf = cf;
-+    ccv.value = &value[1];
-+    ccv.complex_value = h->name;
-+
-+    if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    /*
-+     * Compile header value
-+     */
-+    h->value = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
-+    if(h->value == NULL) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-+
-+    ccv.cf = cf;
-+    ccv.value = &value[2];
-+    ccv.complex_value = h->value;
-+
-+    if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    return NGX_CONF_OK;
-+} /* }}} */
-+
-+static char * /* {{{ ngx_http_upload_cleanup */
-+ngx_http_upload_cleanup(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-+{
-+    ngx_http_upload_loc_conf_t *ulcf = conf;
-+
-+    ngx_str_t                  *value;
-+    ngx_uint_t                 i;
-+    ngx_int_t                  status, lo, hi;
-+    uint16_t                   *s;
-+
-+    value = cf->args->elts;
-+
-+    if (ulcf->cleanup_statuses == NULL) {
-+        ulcf->cleanup_statuses = ngx_array_create(cf->pool, 1,
-+                                        sizeof(uint16_t));
-+        if (ulcf->cleanup_statuses == NULL) {
-+            return NGX_CONF_ERROR;
-+        }
-+    }
-+
-+    for (i = 1; i < cf->args->nelts; i++) {
-+        if(value[i].len > 4 && value[i].data[3] == '-') {
-+            lo = ngx_atoi(value[i].data, 3);
-+
-+            if (lo == NGX_ERROR) {
-+                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-+                                   "invalid lower bound \"%V\"", &value[i]);
-+                return NGX_CONF_ERROR;
-+            }
-+
-+            hi = ngx_atoi(value[i].data + 4, value[i].len - 4);
- 
-             if (hi == NGX_ERROR) {
-                 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-@@ -2453,9 +2894,9 @@
-             hi = lo = status;
-         }
- 
--        if (lo < 400 || hi > 599) {
-+        if (lo < 200 || hi > 599) {
-             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
--                               "value(s) \"%V\" must be between 400 and 599",
-+                               "value(s) \"%V\" must be between 200 and 599",
-                                &value[i]);
-             return NGX_CONF_ERROR;
-         }
-@@ -2523,6 +2964,665 @@
-     return NGX_CONF_OK;
- } /* }}} */
- 
-+static char * /* {{{ ngx_http_upload_set_path_slot */
-+ngx_http_upload_set_path_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-+{
-+    char  *p = conf;
-+
-+    ssize_t      level;
-+    ngx_str_t   *value;
-+    ngx_uint_t   i, n;
-+    ngx_http_upload_path_t *path, **slot;
-+    ngx_http_compile_complex_value_t   ccv;
-+
-+    slot = (ngx_http_upload_path_t **) (p + cmd->offset);
-+
-+    if (*slot) {
-+        return "is duplicate";
-+    }
-+
-+    path = ngx_pcalloc(cf->pool, sizeof(ngx_http_upload_path_t));
-+    if (path == NULL) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    path->path = ngx_pcalloc(cf->pool, sizeof(ngx_path_t));
-+    if (path->path == NULL) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    value = cf->args->elts;
-+
-+    path->path->name = value[1];
-+
-+    if (path->path->name.data[path->path->name.len - 1] == '/') {
-+        path->path->name.len--;
-+    }
-+
-+    if (ngx_conf_full_name(cf->cycle, &path->path->name, 0) != NGX_OK) {
-+        return NULL;
-+    }
-+
-+    path->path->len = 0;
-+    path->path->manager = NULL;
-+    path->path->loader = NULL;
-+    path->path->conf_file = cf->conf_file->file.name.data;
-+    path->path->line = cf->conf_file->line;
-+
-+    for (i = 0, n = 2; n < cf->args->nelts; i++, n++) {
-+        level = ngx_atoi(value[n].data, value[n].len);
-+        if (level == NGX_ERROR || level == 0) {
-+            return "invalid value";
-+        }
-+
-+        path->path->level[i] = level;
-+        path->path->len += level + 1;
-+    }
-+
-+    while (i < 3) {
-+        path->path->level[i++] = 0;
-+    }
-+
-+    *slot = path;
-+
-+    if(ngx_http_script_variables_count(&value[1])) {
-+        ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-+
-+        ccv.cf = cf;
-+        ccv.value = &value[1];
-+        ccv.complex_value = &path->dynamic;
-+
-+        if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
-+            return NGX_CONF_ERROR;
-+        }
-+
-+        path->is_dynamic = 1;
-+    }
-+    else {
-+        if (ngx_add_path(cf, &path->path) == NGX_ERROR) {
-+            return NGX_CONF_ERROR;
-+        }
-+    }
-+
-+    return NGX_CONF_OK;
-+} /* }}} */
-+
-+
-+static char * /* {{{ ngx_http_upload_merge_path_value */
-+ngx_http_upload_merge_path_value(ngx_conf_t *cf, ngx_http_upload_path_t **path, ngx_http_upload_path_t *prev,
-+    ngx_path_init_t *init)
-+{
-+    if (*path) {
-+        return NGX_CONF_OK;
-+    }
-+
-+    if (prev) {
-+        *path = prev;
-+        return NGX_CONF_OK;
-+    }
-+
-+    *path = ngx_palloc(cf->pool, sizeof(ngx_http_upload_path_t));
-+    if(*path == NULL) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    (*path)->path = ngx_pcalloc(cf->pool, sizeof(ngx_path_t));
-+    if((*path)->path == NULL) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    (*path)->path->name = init->name;
-+
-+    if(ngx_conf_full_name(cf->cycle, &(*path)->path->name, 0) != NGX_OK) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    (*path)->path->level[0] = init->level[0];
-+    (*path)->path->level[1] = init->level[1];
-+    (*path)->path->level[2] = init->level[2];
-+
-+    (*path)->path->len = init->level[0] + (init->level[0] ? 1 : 0)
-+                   + init->level[1] + (init->level[1] ? 1 : 0)
-+                   + init->level[2] + (init->level[2] ? 1 : 0);
-+
-+    (*path)->path->manager = NULL;
-+    (*path)->path->loader = NULL;
-+    (*path)->path->conf_file = NULL;
-+
-+    if(ngx_add_path(cf, &(*path)->path) != NGX_OK) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    return NGX_CONF_OK;
-+} /* }}} */
-+
-+static ngx_int_t
-+ngx_http_write_request_body(ngx_http_request_t *r)
-+{
-+    ssize_t                    n;
-+    ngx_chain_t               *cl;
-+    ngx_temp_file_t           *tf;
-+    ngx_http_request_body_t   *rb;
-+    ngx_http_core_loc_conf_t  *clcf;
-+
-+    rb = r->request_body;
-+
-+    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
-+                   "http write client request body, bufs %p", rb->bufs);
-+
-+    if (rb->temp_file == NULL) {
-+        tf = ngx_pcalloc(r->pool, sizeof(ngx_temp_file_t));
-+        if (tf == NULL) {
-+            return NGX_ERROR;
-+        }
-+
-+        clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-+
-+        tf->file.fd = NGX_INVALID_FILE;
-+        tf->file.log = r->connection->log;
-+        tf->path = clcf->client_body_temp_path;
-+        tf->pool = r->pool;
-+        tf->warn = "a client request body is buffered to a temporary file";
-+        tf->log_level = r->request_body_file_log_level;
-+        tf->persistent = r->request_body_in_persistent_file;
-+        tf->clean = r->request_body_in_clean_file;
-+
-+        if (r->request_body_file_group_access) {
-+            tf->access = 0660;
-+        }
-+
-+        rb->temp_file = tf;
-+
-+        if (rb->bufs == NULL) {
-+            /* empty body with r->request_body_in_file_only */
-+
-+            if (ngx_create_temp_file(&tf->file, tf->path, tf->pool,
-+                                     tf->persistent, tf->clean, tf->access)
-+                != NGX_OK)
-+            {
-+                return NGX_ERROR;
-+            }
-+
-+            return NGX_OK;
-+        }
-+    }
-+
-+    if (rb->bufs == NULL) {
-+        return NGX_OK;
-+    }
-+
-+    n = ngx_write_chain_to_temp_file(rb->temp_file, rb->bufs);
-+
-+    /* TODO: n == 0 or not complete and level event */
-+
-+    if (n == NGX_ERROR) {
-+        return NGX_ERROR;
-+    }
-+
-+    rb->temp_file->offset += n;
-+
-+    /* mark all buffers as written */
-+
-+    for (cl = rb->bufs; cl; cl = cl->next) {
-+        cl->buf->pos = cl->buf->last;
-+    }
-+
-+    rb->bufs = NULL;
-+
-+    return NGX_OK;
-+}
-+
-+static ngx_int_t
-+ngx_http_request_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-+{
-+    if (r->headers_in.chunked) {
-+        return ngx_http_request_body_chunked_filter(r, in);
-+
-+    } else {
-+        return ngx_http_request_body_length_filter(r, in);
-+    }
-+}
-+
-+static ngx_int_t
-+ngx_http_request_body_save_filter(ngx_http_request_t *r, ngx_chain_t *in)
-+{
-+#if (NGX_DEBUG)
-+    ngx_chain_t               *cl;
-+#endif
-+    ngx_http_request_body_t   *rb;
-+
-+    rb = r->request_body;
-+
-+#if (NGX_DEBUG)
-+
-+    for (cl = rb->bufs; cl; cl = cl->next) {
-+        ngx_log_debug7(NGX_LOG_DEBUG_EVENT, r->connection->log, 0,
-+                       "http body old buf t:%d f:%d %p, pos %p, size: %z "
-+                       "file: %O, size: %z",
-+                       cl->buf->temporary, cl->buf->in_file,
-+                       cl->buf->start, cl->buf->pos,
-+                       cl->buf->last - cl->buf->pos,
-+                       cl->buf->file_pos,
-+                       cl->buf->file_last - cl->buf->file_pos);
-+    }
-+
-+    for (cl = in; cl; cl = cl->next) {
-+        ngx_log_debug7(NGX_LOG_DEBUG_EVENT, r->connection->log, 0,
-+                       "http body new buf t:%d f:%d %p, pos %p, size: %z "
-+                       "file: %O, size: %z",
-+                       cl->buf->temporary, cl->buf->in_file,
-+                       cl->buf->start, cl->buf->pos,
-+                       cl->buf->last - cl->buf->pos,
-+                       cl->buf->file_pos,
-+                       cl->buf->file_last - cl->buf->file_pos);
-+    }
-+
-+#endif
-+
-+    /* TODO: coalesce neighbouring buffers */
-+
-+    if (ngx_chain_add_copy(r->pool, &rb->bufs, in) != NGX_OK) {
-+        return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+    }
-+
-+    return NGX_OK;
-+}
-+
-+
-+static ngx_int_t
-+ngx_http_request_body_length_filter(ngx_http_request_t *r, ngx_chain_t *in)
-+{
-+    size_t                     size;
-+    ngx_int_t                  rc;
-+    ngx_buf_t                 *b;
-+    ngx_chain_t               *cl, *tl, *out, **ll;
-+    ngx_http_request_body_t   *rb;
-+
-+    rb = r->request_body;
-+
-+    if (rb->rest == -1) {
-+        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
-+                       "http request body content length filter");
-+
-+        rb->rest = r->headers_in.content_length_n;
-+    }
-+
-+    out = NULL;
-+    ll = &out;
-+
-+    for (cl = in; cl; cl = cl->next) {
-+
-+        tl = ngx_chain_get_free_buf(r->pool, &rb->free);
-+        if (tl == NULL) {
-+            return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+        }
-+
-+        b = tl->buf;
-+
-+        ngx_memzero(b, sizeof(ngx_buf_t));
-+
-+        b->temporary = 1;
-+        b->tag = (ngx_buf_tag_t) &ngx_http_read_client_request_body;
-+        b->start = cl->buf->start;
-+        b->pos = cl->buf->pos;
-+        b->last = cl->buf->last;
-+        b->end = cl->buf->end;
-+
-+        size = cl->buf->last - cl->buf->pos;
-+
-+        if ((off_t) size < rb->rest) {
-+            cl->buf->pos = cl->buf->last;
-+            rb->rest -= size;
-+
-+        } else {
-+            cl->buf->pos += rb->rest;
-+            rb->rest = 0;
-+            b->last = cl->buf->pos;
-+            b->last_buf = 1;
-+        }
-+
-+        *ll = tl;
-+        ll = &tl->next;
-+    }
-+
-+    rc = ngx_http_request_body_save_filter(r, out);
-+
-+    ngx_chain_update_chains(r->pool, &rb->free, &rb->busy, &out,
-+                            (ngx_buf_tag_t) &ngx_http_read_client_request_body);
-+
-+    return rc;
-+}
-+
-+static ngx_int_t
-+ngx_http_request_body_chunked_filter(ngx_http_request_t *r, ngx_chain_t *in)
-+{
-+    size_t                     size;
-+    ngx_int_t                  rc;
-+    ngx_buf_t                 *b;
-+    ngx_chain_t               *cl, *out, *tl, **ll;
-+    ngx_http_request_body_t   *rb;
-+    ngx_http_core_loc_conf_t  *clcf;
-+
-+    rb = r->request_body;
-+
-+    if (rb->rest == -1) {
-+
-+        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
-+                       "http request body chunked filter");
-+
-+        rb->chunked = ngx_pcalloc(r->pool, sizeof(ngx_http_chunked_t));
-+        if (rb->chunked == NULL) {
-+            return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+        }
-+
-+        r->headers_in.content_length_n = 0;
-+        rb->rest = 3;
-+    }
-+
-+    out = NULL;
-+    ll = &out;
-+
-+    for (cl = in; cl; cl = cl->next) {
-+
-+        for ( ;; ) {
-+
-+            ngx_log_debug7(NGX_LOG_DEBUG_EVENT, r->connection->log, 0,
-+                           "http body chunked buf "
-+                           "t:%d f:%d %p, pos %p, size: %z file: %O, size: %z",
-+                           cl->buf->temporary, cl->buf->in_file,
-+                           cl->buf->start, cl->buf->pos,
-+                           cl->buf->last - cl->buf->pos,
-+                           cl->buf->file_pos,
-+                           cl->buf->file_last - cl->buf->file_pos);
-+
-+            rc = ngx_http_parse_chunked(r, cl->buf, rb->chunked);
-+
-+            if (rc == NGX_OK) {
-+
-+                /* a chunk has been parsed successfully */
-+
-+                clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-+
-+                if (clcf->client_max_body_size
-+                    && clcf->client_max_body_size
-+                       < r->headers_in.content_length_n + rb->chunked->size)
-+                {
-+                    ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
-+                                  "client intended to send too large chunked "
-+                                  "body: %O bytes",
-+                                  r->headers_in.content_length_n
-+                                  + rb->chunked->size);
-+
-+                    r->lingering_close = 1;
-+
-+                    return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE;
-+                }
-+
-+                tl = ngx_chain_get_free_buf(r->pool, &rb->free);
-+                if (tl == NULL) {
-+                    return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+                }
-+
-+                b = tl->buf;
-+
-+                ngx_memzero(b, sizeof(ngx_buf_t));
-+
-+                b->temporary = 1;
-+                b->tag = (ngx_buf_tag_t) &ngx_http_read_client_request_body;
-+                b->start = cl->buf->start;
-+                b->pos = cl->buf->pos;
-+                b->last = cl->buf->last;
-+                b->end = cl->buf->end;
-+
-+                *ll = tl;
-+                ll = &tl->next;
-+
-+                size = cl->buf->last - cl->buf->pos;
-+
-+                if ((off_t) size > rb->chunked->size) {
-+                   cl->buf->pos += rb->chunked->size;
-+                    r->headers_in.content_length_n += rb->chunked->size;
-+                    rb->chunked->size = 0;
-+
-+                } else {
-+                    rb->chunked->size -= size;
-+                    r->headers_in.content_length_n += size;
-+                    cl->buf->pos = cl->buf->last;
-+                }
-+
-+                b->last = cl->buf->pos;
-+
-+                continue;
-+            }
-+
-+            if (rc == NGX_DONE) {
-+
-+                /* a whole response has been parsed successfully */
-+
-+                rb->rest = 0;
-+
-+                tl = ngx_chain_get_free_buf(r->pool, &rb->free);
-+                if (tl == NULL) {
-+                    return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+                }
-+
-+                b = tl->buf;
-+
-+                ngx_memzero(b, sizeof(ngx_buf_t));
-+
-+                b->last_buf = 1;
-+
-+                *ll = tl;
-+                ll = &tl->next;
-+
-+                break;
-+            }
-+
-+            if (rc == NGX_AGAIN) {
-+
-+                /* set rb->rest, amount of data we want to see next time */
-+
-+                rb->rest = rb->chunked->length;
-+
-+                break;
-+            }
-+
-+            /* invalid */
-+
-+            ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
-+                          "client sent invalid chunked body");
-+
-+            return NGX_HTTP_BAD_REQUEST;
-+        }
-+    }
-+
-+    rc = ngx_http_request_body_save_filter(r, out);
-+
-+    ngx_chain_update_chains(r->pool, &rb->free, &rb->busy, &out,
-+                            (ngx_buf_tag_t) &ngx_http_read_client_request_body);
-+
-+    return rc;
-+}
-+
-+static ngx_int_t
-+ngx_http_do_read_client_request_body(ngx_http_request_t *r)
-+{
-+    off_t                      rest;
-+    size_t                     size;
-+    ssize_t                    n;
-+    ngx_int_t                  rc;
-+    ngx_buf_t                 *b;
-+    ngx_chain_t               *cl, out;
-+    ngx_connection_t          *c;
-+    ngx_http_request_body_t   *rb;
-+    ngx_http_core_loc_conf_t  *clcf;
-+
-+    c = r->connection;
-+    rb = r->request_body;
-+
-+    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
-+                   "http read client request body");
-+
-+    for ( ;; ) {
-+        for ( ;; ) {
-+            if (rb->buf->last == rb->buf->end) {
-+
-+                /* pass buffer to request body filter chain */
-+
-+                out.buf = rb->buf;
-+                out.next = NULL;
-+
-+                rc = ngx_http_request_body_filter(r, &out);
-+
-+                if (rc != NGX_OK) {
-+                    return rc;
-+                }
-+
-+                /* write to file */
-+
-+                if (ngx_http_write_request_body(r) != NGX_OK) {
-+                    return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+                }
-+
-+                /* update chains */
-+
-+                rc = ngx_http_request_body_filter(r, NULL);
-+
-+                if (rc != NGX_OK) {
-+                    return rc;
-+                }
-+
-+                if (rb->busy != NULL) {
-+                    return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+                }
-+
-+                rb->buf->pos = rb->buf->start;
-+                rb->buf->last = rb->buf->start;
-+            }
-+            size = rb->buf->end - rb->buf->last;
-+            rest = rb->rest - (rb->buf->last - rb->buf->pos);
-+
-+            if ((off_t) size > rest) {
-+                size = (size_t) rest;
-+            }
-+
-+            n = c->recv(c, rb->buf->last, size);
-+
-+            ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
-+                           "http client request body recv %z", n);
-+
-+            if (n == NGX_AGAIN) {
-+                break;
-+            }
-+
-+            if (n == 0) {
-+                ngx_log_error(NGX_LOG_INFO, c->log, 0,
-+                              "client prematurely closed connection");
-+            }
-+
-+            if (n == 0 || n == NGX_ERROR) {
-+                c->error = 1;
-+                return NGX_HTTP_BAD_REQUEST;
-+            }
-+
-+            rb->buf->last += n;
-+            r->request_length += n;
-+
-+            if (n == rest) {
-+                /* pass buffer to request body filter chain */
-+
-+                out.buf = rb->buf;
-+                out.next = NULL;
-+
-+                rc = ngx_http_request_body_filter(r, &out);
-+
-+                if (rc != NGX_OK) {
-+                    return rc;
-+                }
-+            }
-+
-+            if (rb->rest == 0) {
-+                break;
-+            }
-+
-+            if (rb->buf->last < rb->buf->end) {
-+                break;
-+            }
-+        }
-+
-+        ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
-+                       "http client request body rest %O", rb->rest);
-+                      if (rb->rest == 0) {
-+            break;
-+        }
-+
-+        if (!c->read->ready) {
-+            clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-+            ngx_add_timer(c->read, clcf->client_body_timeout);
-+
-+            if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
-+                return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+            }
-+
-+            return NGX_AGAIN;
-+        }
-+    }
-+
-+    if (c->read->timer_set) {
-+        ngx_del_timer(c->read);
-+    }
-+
-+    if (rb->temp_file || r->request_body_in_file_only) {
-+
-+        /* save the last part */
-+
-+        if (ngx_http_write_request_body(r) != NGX_OK) {
-+            return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+        }
-+
-+        cl = ngx_chain_get_free_buf(r->pool, &rb->free);
-+        if (cl == NULL) {
-+            return NGX_HTTP_INTERNAL_SERVER_ERROR;
-+        }
-+
-+        b = cl->buf;
-+
-+        ngx_memzero(b, sizeof(ngx_buf_t));
-+
-+        b->in_file = 1;
-+        b->file_last = rb->temp_file->file.offset;
-+        b->file = &rb->temp_file->file;
-+
-+        rb->bufs = cl;
-+    }
-+
-+    r->read_event_handler = ngx_http_block_reading;
-+
-+    rb->post_handler(r);
-+
-+    return NGX_OK;
-+}
-+
-+
-+static void
-+ngx_http_read_client_request_body_handler(ngx_http_request_t *r)
-+{
-+    ngx_int_t  rc;
-+
-+    if (r->connection->read->timedout) {
-+        r->connection->timedout = 1;
-+        ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT);
-+        return;
-+    }
-+
-+    rc = ngx_http_do_read_client_request_body(r);
-+
-+    if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
-+        ngx_http_finalize_request(r, rc);
-+    }
-+}
-+
-+
- ngx_int_t /* {{{ ngx_http_read_upload_client_request_body */
- ngx_http_read_upload_client_request_body(ngx_http_request_t *r) {
-     ssize_t                    size, preread;
-@@ -2625,9 +3725,9 @@
- 
-             /* the whole request body may be placed in r->header_in */
- 
--            rb->to_write = rb->bufs;
--
--            r->read_event_handler = ngx_http_read_upload_client_request_body_handler;
-+            rb->buf = r->header_in;
-+            r->read_event_handler = ngx_http_read_client_request_body_handler;
-+            r->write_event_handler = ngx_http_request_empty_handler;
- 
-             return ngx_http_do_read_upload_client_request_body(r);
-         }
-@@ -2684,7 +3784,9 @@
- 
-     *next = cl;
- 
--    rb->to_write = rb->bufs;
-+    /*
-+     * rb->to_write = rb->bufs;
-+     */
- 
-     r->read_event_handler = ngx_http_read_upload_client_request_body_handler;
- 
-@@ -2766,7 +3868,7 @@
-         for ( ;; ) {
-             if (rb->buf->last == rb->buf->end) {
- 
--                rc = ngx_http_process_request_body(r, rb->to_write);
-+                 rc = ngx_http_process_request_body(r, rb->bufs);
- 
-                 switch(rc) {
-                     case NGX_OK:
-@@ -2781,8 +3883,7 @@
-                     default:
-                         return NGX_HTTP_INTERNAL_SERVER_ERROR;
-                 }
--
--                rb->to_write = rb->bufs->next ? rb->bufs->next : rb->bufs;
-+                rb->bufs = rb->bufs->next ? rb->bufs->next : rb->bufs;
-                 rb->buf->last = rb->buf->start;
-             }
- 
-@@ -2874,7 +3975,7 @@
-         ngx_del_timer(c->read);
-     }
- 
--    rc = ngx_http_process_request_body(r, rb->to_write);
-+    rc = ngx_http_process_request_body(r, rb->bufs);
- 
-     switch(rc) {
-         case NGX_OK:
-@@ -3299,6 +4400,14 @@
-                     return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE;
-                 }
- 
-+                if( (upload_ctx->content_range_n.end - upload_ctx->content_range_n.start + 1)
-+                    != headers_in->content_length_n) 
-+                {
-+                    ngx_log_error(NGX_LOG_ERR, upload_ctx->log, 0,
-+                                  "range length is not equal to content length");
-+                    return NGX_HTTP_RANGE_NOT_SATISFIABLE;
-+                }
-+
-                 upload_ctx->partial_content = 1;
-             }
-         }
-@@ -3436,8 +4545,8 @@
-         return NGX_ERROR;
-     }
- 
--    if(range_n->start >= range_n->end || range_n->start >= range_n->total
--        || range_n->end > range_n->total)
-+    if(range_n->start > range_n->end || range_n->start >= range_n->total
-+        || range_n->end >= range_n->total)
-     {
-         return NGX_ERROR;
-     }
-@@ -3673,3 +4782,43 @@
-     }
- } /* }}} */
- 
-+static ngx_int_t /* {{{ */
-+ngx_http_upload_test_expect(ngx_http_request_t *r)
-+{
-+    ngx_int_t   n;
-+    ngx_str_t  *expect;
-+
-+    if (r->expect_tested
-+        || r->headers_in.expect == NULL
-+        || r->http_version < NGX_HTTP_VERSION_11)
-+    {
-+        return NGX_OK;
-+    }
-+
-+    r->expect_tested = 1;
-+
-+    expect = &r->headers_in.expect->value;
-+
-+    if (expect->len != sizeof("100-continue") - 1
-+        || ngx_strncasecmp(expect->data, (u_char *) "100-continue",
-+                           sizeof("100-continue") - 1)
-+           != 0)
-+    {
-+        return NGX_OK;
-+    }
-+
-+    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
-+                   "send 100 Continue");
-+
-+    n = r->connection->send(r->connection,
-+                            (u_char *) "HTTP/1.1 100 Continue" CRLF CRLF,
-+                            sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1);
-+
-+    if (n == sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1) {
-+        return NGX_OK;
-+    }
-+
-+    /* we assume that such small packet should be send successfully */
-+
-+    return NGX_ERROR;
-+} /* }}} */
-

Deleted: trunk/www/nginx/files/extra-patch-ngx_http_upstream.h
===================================================================
--- trunk/www/nginx/files/extra-patch-ngx_http_upstream.h	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/extra-patch-ngx_http_upstream.h	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,13 +0,0 @@
---- src/http/ngx_http_upstream.h.orig	2010-01-14 04:20:57.000000000 +0300
-+++ src/http/ngx_http_upstream.h	2010-01-14 04:22:00.000000000 +0300
-@@ -105,6 +105,10 @@
- 
-     ngx_array_t                     *servers;  /* ngx_http_upstream_server_t */
- 
-+    ngx_array_t                     *values;
-+    ngx_array_t                     *lengths;
-+    ngx_uint_t                       retries;
-+
-     ngx_uint_t                       flags;
-     ngx_str_t                        host;
-     u_char                          *file_name;

Modified: trunk/www/nginx/files/extra-patch-ngx_postgres-config
===================================================================
--- trunk/www/nginx/files/extra-patch-ngx_postgres-config	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/extra-patch-ngx_postgres-config	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,5 +1,5 @@
---- ../ngx_postgres-0.9/config.orig	2011-12-29 11:17:24.000000000 +0400
-+++ ../ngx_postgres-0.9/config	2011-12-29 11:18:47.000000000 +0400
+--- ../ngx_postgres-1.0rc7/config.orig	2015-05-26 20:52:25.649166000 +0300
++++ ../ngx_postgres-1.0rc7/config	2015-05-26 20:53:10.331122000 +0300
 @@ -48,12 +48,12 @@
  
      if [ $ngx_found = no ]; then

Added: trunk/www/nginx/files/extra-patch-openresty-drizzle-nginx-module-config
===================================================================
--- trunk/www/nginx/files/extra-patch-openresty-drizzle-nginx-module-config	                        (rev 0)
+++ trunk/www/nginx/files/extra-patch-openresty-drizzle-nginx-module-config	2016-03-04 23:15:31 UTC (rev 21049)
@@ -0,0 +1,19 @@
+--- ../drizzle-nginx-module-0.1.9/config.orig	2011-12-30 10:26:53.000000000 +0400
++++ ../drizzle-nginx-module-0.1.9/config	2011-12-30 10:28:20.000000000 +0400
+@@ -22,12 +22,12 @@
+ 
+     if [ $ngx_found = no ]; then
+         # FreeBSD, OpenBSD
+-        ngx_feature="libdrizzle library in /usr/local/"
+-        ngx_feature_path="/usr/local/include/libdrizzle-1.0"
++        ngx_feature="libdrizzle library in %%PREFIX%%"
++        ngx_feature_path="%%PREFIX%%/include/libdrizzle"
+         if [ $NGX_RPATH = YES ]; then
+-            ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -ldrizzle"
++            ngx_feature_libs="-R%%PREFIX%%/lib -L%%PREFIX%%/lib -ldrizzle"
+         else
+-            ngx_feature_libs="-L/usr/local/lib -ldrizzle"
++            ngx_feature_libs="-L%%PREFIX%%/lib -ldrizzle"
+         fi
+         . auto/feature
+     fi


Property changes on: trunk/www/nginx/files/extra-patch-openresty-drizzle-nginx-module-config
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Deleted: trunk/www/nginx/files/extra-patch-openresty-set-misc-nginx-module-config
===================================================================
--- trunk/www/nginx/files/extra-patch-openresty-set-misc-nginx-module-config	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/extra-patch-openresty-set-misc-nginx-module-config	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,13 +0,0 @@
---- ../openresty-set-misc-nginx-module-36fd035/config.orig       2011-12-09 10:27:53.861265188 +0300
-+++ ../openresty-set-misc-nginx-module-36fd035/config    2011-12-09 10:28:07.107259301 +0300
-@@ -1,10 +1,3 @@
--if echo $HTTP_MODULES | grep " ndk_http_module" > /dev/null; then
--    echo "found ngx_devel_kit for ngx_set_misc; looks good."
--else
--    echo "error: ngx_devel_kit is required to build ngx_set_misc; please put it before ngx_set_misc." 1>&2
--    exit 1
--fi
--
- ngx_addon_name=ngx_http_set_misc_module
- HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_set_misc_module"
- NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_set_base32.c $ngx_addon_dir/src/ngx_http_set_default_value.c $ngx_addon_dir/src/ngx_http_set_hashed_upstream.c $ngx_addon_dir/src/ngx_http_set_quote_sql.c $ngx_addon_dir/src/ngx_http_set_quote_json.c $ngx_addon_dir/src/ngx_http_set_unescape_uri.c $ngx_addon_dir/src/ngx_http_set_misc_module.c $ngx_addon_dir/src/ngx_http_set_escape_uri.c $ngx_addon_dir/src/ngx_http_set_hash.c $ngx_addon_dir/src/ngx_http_set_local_today.c $ngx_addon_dir/src/ngx_http_set_hex.c $ngx_addon_dir/src/ngx_http_set_base64.c $ngx_addon_dir/src/ngx_http_set_random.c"

Modified: trunk/www/nginx/files/extra-patch-passenger-build-nginx.rb
===================================================================
--- trunk/www/nginx/files/extra-patch-passenger-build-nginx.rb	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/extra-patch-passenger-build-nginx.rb	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,22 +1,18 @@
---- ../passenger-4.0.45/build/nginx.rb.orig	2013-10-27 02:00:00.000000000 +0400
-+++ ../passenger-4.0.45/build/nginx.rb	2014-06-02 05:55:12.000000000 +0400
+--- ../passenger-5.0.26/build/nginx.rb.orig	2013-10-27 02:00:00.000000000 +0400
++++ ../passenger-5.0.26/build/nginx.rb	2015-09-26 02:05:27.664684000 +0300
 @@ -32,6 +32,7 @@
  desc "Build Nginx support files"
  task :nginx => [
- 	:nginx_without_native_support,
-+	LIBBOOST_OXT,
- 	NATIVE_SUPPORT_TARGET
+   :nginx_without_native_support,
++  LIBBOOST_OXT,
+   NATIVE_SUPPORT_TARGET
  ].compact
  
-@@ -40,11 +41,6 @@
+@@ -40,7 +41,6 @@
  
  task :nginx_without_native_support => [
- 	auto_generated_sources,
--	AGENT_OUTPUT_DIR + 'PassengerHelperAgent',
--	AGENT_OUTPUT_DIR + 'PassengerWatchdog',
--	AGENT_OUTPUT_DIR + 'PassengerLoggingAgent',
--	AGENT_OUTPUT_DIR + 'SpawnPreparer',
--	AGENT_OUTPUT_DIR + 'TempDirToucher',
- 	COMMON_LIBRARY.only(*NGINX_LIBS_SELECTOR).link_objects
+   auto_generated_sources,
+-  AGENT_TARGET,
+   COMMON_LIBRARY.only(*NGINX_LIBS_SELECTOR).link_objects
  ].flatten
  

Added: trunk/www/nginx/files/extra-patch-spnego-http-auth-nginx-module-config
===================================================================
--- trunk/www/nginx/files/extra-patch-spnego-http-auth-nginx-module-config	                        (rev 0)
+++ trunk/www/nginx/files/extra-patch-spnego-http-auth-nginx-module-config	2016-03-04 23:15:31 UTC (rev 21049)
@@ -0,0 +1,8 @@
+--- ../spnego-http-auth-nginx-module-c85a38c/config.orig	2015-06-13 20:49:15.590751000 +0300
++++ ../spnego-http-auth-nginx-module-c85a38c/config	2015-06-13 20:49:31.024936000 +0300
+@@ -1,4 +1,4 @@
+ ngx_addon_name=ngx_http_auth_spnego_module
+ HTTP_MODULES="$HTTP_MODULES ngx_http_auth_spnego_module"
+ NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_auth_spnego_module.c"
+-CORE_LIBS="$CORE_LIBS -lgssapi_krb5 -lkrb5 -lcom_err"
++CORE_LIBS="$CORE_LIBS %%GSSAPILIBS%% -lcom_err"


Property changes on: trunk/www/nginx/files/extra-patch-spnego-http-auth-nginx-module-config
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Deleted: trunk/www/nginx/files/extra-patch-syslog_support
===================================================================
--- trunk/www/nginx/files/extra-patch-syslog_support	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/extra-patch-syslog_support	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,762 +0,0 @@
-diff --git src/core/ngx_cycle.c src/core/ngx_cycle.c
-index dc4dc89..46c4b4f 100644
---- src/core/ngx_cycle.c
-+++ src/core/ngx_cycle.c
-@@ -85,6 +85,12 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
-     cycle->pool = pool;
-     cycle->log = log;
-     cycle->new_log.log_level = NGX_LOG_ERR;
-+#if (NGX_ENABLE_SYSLOG)
-+    cycle->new_log.facility = SYSLOG_FACILITY;
-+    cycle->new_log.facility = ERR_SYSLOG_PRIORITY;
-+    cycle->new_log.syslog_on = 0;
-+    cycle->new_log.syslog_set = 0;
-+#endif
-     cycle->old_cycle = old_cycle;
- 
-     cycle->conf_prefix.len = old_cycle->conf_prefix.len;
-diff --git src/core/ngx_log.c src/core/ngx_log.c
-index d7830fb..982c2ed 100644
---- src/core/ngx_log.c
-+++ src/core/ngx_log.c
-@@ -10,6 +10,15 @@
- 
- 
- static char *ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-+#if (NGX_ENABLE_SYSLOG)
-+static char *ngx_set_syslog(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-+void log_exit(ngx_cycle_t *cycle);
-+
-+typedef struct{
-+    ngx_str_t     name;
-+    ngx_int_t     macro;
-+} ngx_string_to_macro_t;
-+#endif
- 
- 
- static ngx_command_t  ngx_errlog_commands[] = {
-@@ -21,6 +30,15 @@ static ngx_command_t  ngx_errlog_commands[] = {
-      0,
-      NULL},
- 
-+#if (NGX_ENABLE_SYSLOG)
-+    {ngx_string("syslog"),
-+     NGX_MAIN_CONF|NGX_CONF_TAKE12,
-+     ngx_set_syslog,
-+     0,
-+     0,
-+     NULL},
-+#endif
-+
-     ngx_null_command
- };
- 
-@@ -43,7 +61,11 @@ ngx_module_t  ngx_errlog_module = {
-     NULL,                                  /* init thread */
-     NULL,                                  /* exit thread */
-     NULL,                                  /* exit process */
--    NULL,                                  /* exit master */
-+#if (NGX_ENABLE_SYSLOG)
-+    log_exit,                              /* exit master */
-+#else
-+    NULL,
-+#endif
-     NGX_MODULE_V1_PADDING
- };
- 
-@@ -52,6 +74,48 @@ static ngx_log_t        ngx_log;
- static ngx_open_file_t  ngx_log_file;
- ngx_uint_t              ngx_use_stderr = 1;
- 
-+#if (NGX_ENABLE_SYSLOG)
-+static ngx_string_to_macro_t ngx_syslog_facilities[] = {
-+    {ngx_string("auth"),     LOG_AUTH},
-+#if !(NGX_SOLARIS)
-+    {ngx_string("authpriv"), LOG_AUTHPRIV},
-+#endif
-+    {ngx_string("cron"),     LOG_CRON},
-+    {ngx_string("daemon"),   LOG_DAEMON},
-+#if !(NGX_SOLARIS)
-+    {ngx_string("ftp"),      LOG_FTP},
-+#endif
-+    {ngx_string("kern"),     LOG_KERN},
-+    {ngx_string("local0"),   LOG_LOCAL0},
-+    {ngx_string("local1"),   LOG_LOCAL1},
-+    {ngx_string("local2"),   LOG_LOCAL2},
-+    {ngx_string("local3"),   LOG_LOCAL3},
-+    {ngx_string("local4"),   LOG_LOCAL4},
-+    {ngx_string("local5"),   LOG_LOCAL5},
-+    {ngx_string("local6"),   LOG_LOCAL6},
-+    {ngx_string("local7"),   LOG_LOCAL7},
-+    {ngx_string("lpr"),      LOG_LPR},
-+    {ngx_string("mail"),     LOG_MAIL},
-+    {ngx_string("news"),     LOG_NEWS},
-+    {ngx_string("syslog"),   LOG_SYSLOG},
-+    {ngx_string("user"),     LOG_USER},
-+    {ngx_string("uucp"),     LOG_UUCP},
-+    { ngx_null_string, 0}
-+};
-+
-+static ngx_string_to_macro_t ngx_syslog_priorities[] = {
-+    {ngx_string("emerg"), LOG_EMERG},
-+    {ngx_string("alert"), LOG_ALERT},
-+    {ngx_string("crit"),  LOG_CRIT},
-+    {ngx_string("error"), LOG_ERR},
-+    {ngx_string("err"),   LOG_ERR},
-+    {ngx_string("warn"),  LOG_WARNING},
-+    {ngx_string("notice"),LOG_NOTICE},
-+    {ngx_string("info"),  LOG_INFO},
-+    {ngx_string("debug"), LOG_DEBUG},
-+    { ngx_null_string, 0}
-+};
-+#endif
- 
- static ngx_str_t err_levels[] = {
-     ngx_null_string,
-@@ -89,11 +153,16 @@ ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
-     va_list  args;
- #endif
-     u_char  *p, *last, *msg;
-+#if (NGX_ENABLE_SYSLOG)
-+    u_char *errstr_syslog;
-+#endif
-     u_char   errstr[NGX_MAX_ERROR_STR];
- 
-+#if !(NGX_ENABLE_SYSLOG)
-     if (log->file->fd == NGX_INVALID_FILE) {
-         return;
-     }
-+#endif
- 
-     last = errstr + NGX_MAX_ERROR_STR;
- 
-@@ -102,6 +171,10 @@ ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
- 
-     p = errstr + ngx_cached_err_log_time.len;
- 
-+#if (NGX_ENABLE_SYSLOG)
-+    errstr_syslog = p;
-+#endif
-+
-     p = ngx_slprintf(p, last, " [%V] ", &err_levels[level]);
- 
-     /* pid#tid */
-@@ -140,11 +213,27 @@ ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
- 
-     ngx_linefeed(p);
- 
-+#if (NGX_ENABLE_SYSLOG)
-+    if (log->file != NULL && log->file->name.len != 0) {
-     (void) ngx_write_fd(log->file->fd, errstr, p - errstr);
-+    }
-+
-+    /* Don't send the debug level info to syslog */
-+    if (log->syslog_on && level < NGX_LOG_DEBUG) {
-+        /* write to syslog */
-+        syslog(log->priority, "%.*s", (int)(p - errstr_syslog), errstr_syslog);
-+    }
-+#else
-+    (void) ngx_write_fd(log->file->fd, errstr, p - errstr);
-+#endif
- 
-     if (!ngx_use_stderr
-         || level > NGX_LOG_WARN
-+#if (NGX_ENABLE_SYSLOG)
-+        || (log->file != NULL && log->file->fd == ngx_stderr))
-+#else
-         || log->file->fd == ngx_stderr)
-+#endif
-     {
-         return;
-     }
-@@ -367,6 +456,50 @@ ngx_log_create(ngx_cycle_t *cycle, ngx_str_t *name)
- }
- 
- 
-+#if (NGX_ENABLE_SYSLOG)
-+ngx_int_t
-+ngx_log_get_priority(ngx_conf_t *cf, ngx_str_t *priority)
-+{
-+    ngx_int_t  p = 0;
-+    ngx_uint_t n, match = 0;
-+
-+    for (n = 0; ngx_syslog_priorities[n].name.len != 0; n++) {
-+        if (ngx_strncmp(priority->data, ngx_syslog_priorities[n].name.data, 
-+                    ngx_syslog_priorities[n].name.len) == 0) {
-+            p = ngx_syslog_priorities[n].macro;
-+            match = 1;
-+        }
-+    }
-+
-+    if (!match) {
-+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-+                "invalid syslog priority \"%V\"", priority);
-+        return -1;
-+    }
-+
-+    return p;
-+}
-+
-+
-+char *
-+ngx_log_set_priority(ngx_conf_t *cf, ngx_str_t *priority, ngx_log_t *log)
-+{
-+    log->priority = ERR_SYSLOG_PRIORITY;
-+
-+    if (priority->len == 0) {
-+        return NGX_CONF_OK;
-+    }
-+
-+    log->priority = ngx_log_get_priority(cf, priority);
-+    if (log->priority == (-1)) {
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    return NGX_CONF_OK;
-+}
-+#endif
-+
-+
- char *
- ngx_log_set_levels(ngx_conf_t *cf, ngx_log_t *log)
- {
-@@ -429,6 +562,13 @@ static char *
- ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
- {
-     ngx_str_t  *value, name;
-+#if (NGX_ENABLE_SYSLOG)
-+    u_char     *off = NULL;
-+    ngx_str_t  priority;
-+
-+    ngx_str_null(&name);
-+    ngx_str_null(&priority);
-+#endif
- 
-     if (cf->cycle->new_log.file) {
-         return "is duplicate";
-@@ -436,7 +576,44 @@ ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
- 
-     value = cf->args->elts;
- 
-+#if (NGX_ENABLE_SYSLOG)
-+    if (ngx_strncmp(value[1].data, "syslog", sizeof("syslog") - 1) == 0) {
-+        if (!cf->cycle->new_log.syslog_set) {
-+            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-+                    "You must set the syslog directive and enable it first.");
-+            return NGX_CONF_ERROR;
-+        }
-+
-+        cf->cycle->new_log.syslog_on = 1;
-+
-+        if (value[1].data[sizeof("syslog") - 1] == ':') {
-+            priority.len = value[1].len - sizeof("syslog");
-+            priority.data = value[1].data + sizeof("syslog");
-+
-+            off = (u_char *)ngx_strchr(priority.data, (int) '|');
-+            if (off != NULL) {
-+                priority.len = off - priority.data;
-+
-+                off++;
-+                name.len = value[1].data + value[1].len - off;
-+                name.data = off;
-+            }
-+        }
-+        else {
-+            if (value[1].len > sizeof("syslog")) {
-+                name.len = value[1].len - sizeof("syslog");
-+                name.data = value[1].data + sizeof("syslog");
-+            }
-+        }
-+
-+        if (ngx_log_set_priority(cf, &priority, &cf->cycle->new_log) == NGX_CONF_ERROR) {
-+            return NGX_CONF_ERROR;
-+        }
-+    }
-+    else if (ngx_strcmp(value[1].data, "stderr") == 0) {
-+#else
-     if (ngx_strcmp(value[1].data, "stderr") == 0) {
-+#endif
-         ngx_str_null(&name);
- 
-     } else {
-@@ -457,3 +634,63 @@ ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
- 
-     return ngx_log_set_levels(cf, &cf->cycle->new_log);
- }
-+
-+
-+#if (NGX_ENABLE_SYSLOG)
-+
-+#define SYSLOG_IDENT_NAME "nginx"
-+
-+static char *
-+ngx_set_syslog(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-+{
-+    char       *program;
-+    ngx_str_t  *value;
-+    ngx_int_t   facility, match = 0;
-+    ngx_uint_t  n;
-+
-+    value = cf->args->elts;
-+
-+    if (cf->cycle->new_log.syslog_set) {
-+        return "is duplicate";
-+    }
-+
-+    cf->cycle->new_log.syslog_set = 1;
-+
-+    for (n = 0; ngx_syslog_facilities[n].name.len != 0; n++) {
-+        if (ngx_strncmp(value[1].data, ngx_syslog_facilities[n].name.data, 
-+                    ngx_syslog_facilities[n].name.len) == 0) {
-+            facility = ngx_syslog_facilities[n].macro;
-+            match = 1;
-+            break;
-+        }
-+    }
-+
-+    if (match) {
-+        cf->cycle->new_log.facility = facility;
-+        cf->cycle->new_log.priority = ERR_SYSLOG_PRIORITY;
-+    }
-+    else {
-+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-+                "invalid syslog facility \"%V\"", &value[1]);
-+        return NGX_CONF_ERROR;
-+    }
-+
-+    program = SYSLOG_IDENT_NAME; 
-+    if (cf->args->nelts > 2) {
-+        program = (char *) value[2].data;
-+    }
-+
-+    openlog(program, LOG_ODELAY, facility);
-+
-+    return NGX_CONF_OK;
-+}
-+
-+
-+void log_exit(ngx_cycle_t *cycle)
-+{
-+    if (cycle->new_log.syslog_set) {
-+        closelog();
-+    }
-+}
-+#endif
-+
-diff --git src/core/ngx_log.h src/core/ngx_log.h
-index 3233647..5e7fdbf 100644
---- src/core/ngx_log.h
-+++ src/core/ngx_log.h
-@@ -12,6 +12,15 @@
- #include <ngx_config.h>
- #include <ngx_core.h>
- 
-+#if (NGX_ENABLE_SYSLOG)
-+#include <syslog.h>
-+
-+#ifndef SYSLOG_FACILITY
-+#define SYSLOG_FACILITY LOG_LOCAL5
-+#endif
-+#define ERR_SYSLOG_PRIORITY LOG_ERR
-+#endif
-+
- 
- #define NGX_LOG_STDERR            0
- #define NGX_LOG_EMERG             1
-@@ -61,6 +68,13 @@ struct ngx_log_s {
-      */
- 
-     char                *action;
-+
-+#if (NGX_ENABLE_SYSLOG)
-+    ngx_int_t           priority;
-+    ngx_int_t           facility;
-+    unsigned            syslog_on:1;      /* unsigned :1 syslog_on */
-+    unsigned            syslog_set:1;      /*unsigned :1 syslog_set */
-+#endif
- };
- 
- 
-@@ -221,6 +235,10 @@ void ngx_cdecl ngx_log_debug_core(ngx_log_t *log, ngx_err_t err,
- 
- ngx_log_t *ngx_log_init(u_char *prefix);
- ngx_log_t *ngx_log_create(ngx_cycle_t *cycle, ngx_str_t *name);
-+#if (NGX_ENABLE_SYSLOG)
-+ngx_int_t ngx_log_get_priority(ngx_conf_t *cf, ngx_str_t *priority);
-+char * ngx_log_set_priority(ngx_conf_t *cf, ngx_str_t *priority, ngx_log_t *log);
-+#endif
- char *ngx_log_set_levels(ngx_conf_t *cf, ngx_log_t *log);
- void ngx_cdecl ngx_log_abort(ngx_err_t err, const char *fmt, ...);
- void ngx_cdecl ngx_log_stderr(ngx_err_t err, const char *fmt, ...);
-diff --git src/http/modules/ngx_http_log_module.c src/http/modules/ngx_http_log_module.c
-index aa6a3fc..deceb38 100644
---- src/http/modules/ngx_http_log_module.c
-+++ src/http/modules/ngx_http_log_module.c
-@@ -13,6 +13,11 @@
- #include <zlib.h>
- #endif
- 
-+#if (NGX_ENABLE_SYSLOG)
-+#include <syslog.h>
-+
-+#define HTTP_SYSLOG_PRIORITY LOG_NOTICE
-+#endif
- 
- typedef struct ngx_http_log_op_s  ngx_http_log_op_t;
- 
-@@ -67,6 +72,11 @@ typedef struct {
-     time_t                      disk_full_time;
-     time_t                      error_log_time;
-     ngx_http_log_fmt_t         *format;
-+
-+#if (NGX_ENABLE_SYSLOG)
-+    ngx_int_t                   priority;
-+    unsigned                    syslog_on:1;      /* unsigned :1 syslog_on */
-+#endif
- } ngx_http_log_t;
- 
- 
-@@ -348,6 +358,14 @@ ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log, u_char *buf,
-     time_t               now;
-     ssize_t              n;
-     ngx_err_t            err;
-+
-+#if (NGX_ENABLE_SYSLOG)
-+    n = 0;
-+    if (log->syslog_on) {
-+        syslog(log->priority, "%.*s", (int)len, buf);
-+    }
-+#endif
-+
- #if (NGX_ZLIB)
-     ngx_http_log_buf_t  *buffer;
- #endif
-@@ -355,6 +373,9 @@ ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log, u_char *buf,
-     if (log->script == NULL) {
-         name = log->file->name.data;
- 
-+#if (NGX_ENABLE_SYSLOG)
-+        if (name != NULL) {
-+#endif
- #if (NGX_ZLIB)
-         buffer = log->file->data;
- 
-@@ -367,7 +388,11 @@ ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log, u_char *buf,
- #else
-         n = ngx_write_fd(log->file->fd, buf, len);
- #endif
--
-+#if (NGX_ENABLE_SYSLOG)
-+        } else {
-+            n = len;
-+        }
-+#endif
-     } else {
-         name = NULL;
-         n = ngx_http_log_script_write(r, log->script, &name, buf, len);
-@@ -1068,6 +1093,10 @@ ngx_http_log_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-     log->script = NULL;
-     log->disk_full_time = 0;
-     log->error_log_time = 0;
-+#if (NGX_ENABLE_SYSLOG)
-+    log->priority = HTTP_SYSLOG_PRIORITY;
-+    log->syslog_on = 0;
-+#endif
- 
-     lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module);
-     fmt = lmcf->formats.elts;
-@@ -1096,6 +1125,13 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-     ngx_http_log_main_conf_t   *lmcf;
-     ngx_http_script_compile_t   sc;
- 
-+#if (NGX_ENABLE_SYSLOG)
-+    u_char                     *off;
-+    ngx_str_t                   priority;
-+    ngx_uint_t                  syslog_on = 0;
-+    name = priority = (ngx_str_t)ngx_null_string;
-+#endif
-+
-     value = cf->args->elts;
- 
-     if (ngx_strcmp(value[1].data, "off") == 0) {
-@@ -1108,6 +1144,38 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-                            "invalid parameter \"%V\"", &value[2]);
-         return NGX_CONF_ERROR;
-     }
-+#if (NGX_ENABLE_SYSLOG)
-+    else if (ngx_strncmp(value[1].data, "syslog", sizeof("syslog") - 1) == 0) {
-+        if (!cf->cycle->new_log.syslog_set) {
-+            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-+                               "You must set the syslog directive and enable it first.");
-+            return NGX_CONF_ERROR;
-+        }
-+
-+        syslog_on = 1;
-+        if (value[1].data[sizeof("syslog") - 1] == ':') {
-+            priority.len = value[1].len - sizeof("syslog");
-+            priority.data = value[1].data + sizeof("syslog");
-+
-+            off = (u_char*) ngx_strchr(priority.data, '|'); 
-+            if (off != NULL) {
-+                priority.len = off - priority.data;
-+                
-+                off++;
-+                name.len = value[1].data + value[1].len - off;
-+                name.data = off;
-+            }
-+        }
-+        else {
-+            if (value[1].len > sizeof("syslog")) {
-+                name.len = value[1].len - sizeof("syslog");
-+                name.data = value[1].data + sizeof("syslog");
-+            }
-+        }
-+    } else {
-+        name = value[1];
-+    }
-+#endif
- 
-     if (llcf->logs == NULL) {
-         llcf->logs = ngx_array_create(cf->pool, 2, sizeof(ngx_http_log_t));
-@@ -1125,6 +1193,52 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
- 
-     ngx_memzero(log, sizeof(ngx_http_log_t));
- 
-+#if (NGX_ENABLE_SYSLOG)
-+    log->syslog_on = syslog_on;
-+
-+    if (priority.len == 0) {
-+        log->priority = HTTP_SYSLOG_PRIORITY;
-+    }
-+    else {
-+        log->priority = ngx_log_get_priority(cf, &priority);
-+    }
-+
-+    if (name.len != 0) {
-+        n = ngx_http_script_variables_count(&name);
-+
-+        if (n == 0) {
-+            log->file = ngx_conf_open_file(cf->cycle, &name);
-+            if (log->file == NULL) {
-+                return NGX_CONF_ERROR;
-+            }
-+        } else {
-+            if (ngx_conf_full_name(cf->cycle, &name, 0) != NGX_OK) {
-+                return NGX_CONF_ERROR;
-+            }
-+            log->script = ngx_pcalloc(cf->pool, sizeof(ngx_http_log_script_t));
-+            if (log->script == NULL) {
-+                return NGX_CONF_ERROR;
-+            }
-+            ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-+            sc.cf = cf;
-+            sc.source = &name;
-+            sc.lengths = &log->script->lengths;
-+            sc.values = &log->script->values;
-+            sc.variables = n;
-+            sc.complete_lengths = 1;
-+            sc.complete_values = 1;
-+            if (ngx_http_script_compile(&sc) != NGX_OK) {
-+                return NGX_CONF_ERROR;
-+            }
-+        }
-+    }
-+    else {
-+        log->file = ngx_conf_open_file(cf->cycle, &name);
-+        if (log->file == NULL) {
-+            return NGX_CONF_ERROR;
-+        }
-+    }
-+#else
-     n = ngx_http_script_variables_count(&value[1]);
- 
-     if (n == 0) {
-@@ -1157,6 +1271,7 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-             return NGX_CONF_ERROR;
-         }
-     }
-+#endif
- 
-     if (cf->args->nelts >= 3) {
-         name = value[2];
-diff --git src/http/ngx_http_core_module.c src/http/ngx_http_core_module.c
-index c491499..4f039eb 100644
---- src/http/ngx_http_core_module.c
-+++ src/http/ngx_http_core_module.c
-@@ -1462,6 +1462,9 @@ ngx_http_update_location_config(ngx_http_request_t *r)
- 
-     if (r == r->main) {
-         ngx_http_set_connection_log(r->connection, clcf->error_log);
-+#if (NGX_ENABLE_SYSLOG)
-+        r->connection->log->priority = clcf->error_log->priority;
-+#endif
-     }
- 
-     if ((ngx_io.flags & NGX_IO_SENDFILE) && clcf->sendfile) {
-@@ -4867,6 +4870,15 @@ ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
- 
-     ngx_str_t  *value, name;
- 
-+#if (NGX_ENABLE_SYSLOG)
-+    u_char     *off = NULL;
-+    ngx_int_t   syslog_on = 0;
-+    ngx_str_t   priority;
-+
-+    name = priority = (ngx_str_t) ngx_null_string;
-+#endif
-+
-+
-     if (clcf->error_log) {
-         return "is duplicate";
-     }
-@@ -4876,6 +4888,36 @@ ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-     if (ngx_strcmp(value[1].data, "stderr") == 0) {
-         ngx_str_null(&name);
- 
-+#if (NGX_ENABLE_SYSLOG)
-+    } else if (ngx_strncmp(value[1].data, "syslog", sizeof("syslog") - 1) == 0) {
-+        if (!cf->cycle->new_log.syslog_set) {
-+            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-+                    "You must set the syslog directive and enable it first.");
-+            return NGX_CONF_ERROR;
-+        }
-+
-+        syslog_on = 1;
-+
-+        if (value[1].data[sizeof("syslog") - 1] == ':') {
-+            priority.len = value[1].len - sizeof("syslog");
-+            priority.data = value[1].data + sizeof("syslog");
-+
-+            off = (u_char*) ngx_strchr(priority.data, '|'); 
-+            if (off != NULL) {
-+                priority.len = off - priority.data;
-+
-+                off++;
-+                name.len = value[1].data + value[1].len - off;
-+                name.data = off;
-+            }
-+        }
-+        else {
-+            if (value[1].len > sizeof("syslog")) {
-+                name.len = value[1].len - sizeof("syslog");
-+                name.data = value[1].data + sizeof("syslog");
-+            }
-+        }
-+#endif
-     } else {
-         name = value[1];
-     }
-@@ -4885,6 +4927,17 @@ ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-         return NGX_CONF_ERROR;
-     }
- 
-+#if (NGX_ENABLE_SYSLOG)
-+    if (syslog_on) {
-+        clcf->error_log->syslog_on = 1;
-+        if (ngx_log_set_priority(cf, &priority, clcf->error_log) == NGX_CONF_ERROR) {
-+            return NGX_CONF_ERROR;
-+        }
-+    }
-+
-+    clcf->error_log->log_level = 0;
-+#endif
-+
-     if (cf->args->nelts == 2) {
-         clcf->error_log->log_level = NGX_LOG_ERR;
-         return NGX_CONF_OK;
-diff --git src/http/ngx_http_request.c src/http/ngx_http_request.c
-index 54e1c26..2b05157 100644
---- src/http/ngx_http_request.c
-+++ src/http/ngx_http_request.c
-@@ -424,6 +424,9 @@ ngx_http_init_request(ngx_event_t *rev)
-     clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- 
-     ngx_http_set_connection_log(r->connection, clcf->error_log);
-+#if (NGX_ENABLE_SYSLOG)
-+    c->log->priority = clcf->error_log->priority;
-+#endif
- 
-     if (c->buffer == NULL) {
-         c->buffer = ngx_create_temp_buf(c->pool,
-@@ -694,6 +697,9 @@ ngx_http_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg)
-     clcf = ngx_http_get_module_loc_conf(hc->conf_ctx, ngx_http_core_module);
- 
-     ngx_http_set_connection_log(c, clcf->error_log);
-+#if (NGX_ENABLE_SYSLOG)
-+    c->log->priority = clcf->error_log->priority;
-+#endif
- 
-     sscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_ssl_module);
- 
-@@ -1891,6 +1897,9 @@ ngx_http_set_virtual_server(ngx_http_request_t *r, ngx_str_t *host)
-     clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- 
-     ngx_http_set_connection_log(r->connection, clcf->error_log);
-+#if (NGX_ENABLE_SYSLOG)
-+    r->connection->log->priority = clcf->error_log->priority;
-+#endif
- 
-     return NGX_OK;
- }
---- auto/summary.orig	2010-07-08 19:57:36.000000000 +0400
-+++ auto/summary	2010-12-08 12:25:16.000000000 +0300
-@@ -73,6 +73,11 @@
-     *)     echo "  + using libatomic_ops library: $NGX_LIBATOMIC" ;;
- esac
- 
-+case $USE_SYSLOG in
-+    YES)   echo "  + using syslog with $SYSLOG_FACILITY facility" ;;
-+    *)     echo "  + syslog is not used" ;;
-+esac
-+
- echo
- 
- 
---- auto/make.orig	2009-05-12 17:15:43.000000000 +0400
-+++ auto/make	2010-12-08 12:32:25.000000000 +0300
-@@ -15,6 +15,13 @@
- ngx_objs_dir=$NGX_OBJS$ngx_regex_dirsep
- ngx_use_pch=`echo $NGX_USE_PCH | sed -e "s/\//$ngx_regex_dirsep/g"`
- 
-+#SYSLOG
-+if test -z "${SYSLOG_FACILITY}"; then
-+    SYSLOG_FACILITY="LOG_DAEMON"
-+fi
-+if test "${USE_SYSLOG}" = "YES"; then
-+    CFLAGS="$CFLAGS -DNGX_ENABLE_SYSLOG -DSYSLOG_FACILITY=${SYSLOG_FACILITY}"
-+fi
- 
- cat << END                                                     > $NGX_MAKEFILE
- 
---- auto/options.orig	2011-11-01 09:01:14.000000000 +0400
-+++ auto/options	2011-11-01 09:02:42.000000000 +0400
-@@ -120,6 +120,8 @@
- MD5_OPT=
- MD5_ASM=NO
- 
-+USE_SYSLOG=NO
-+
- USE_SHA1=NO
- SHA1=NONE
- SHA1_OPT=
-@@ -274,6 +276,9 @@
-         --with-md5-opt=*)                MD5_OPT="$value"           ;;
-         --with-md5-asm)                  MD5_ASM=YES                ;;
- 
-+        --with-syslog)                   USE_SYSLOG=YES             ;;
-+        --with-syslog-facility=*)        SYSLOG_FACILITY="$value"   ;;
-+
-         --with-sha1=*)                   SHA1="$value"              ;;
-         --with-sha1-opt=*)               SHA1_OPT="$value"          ;;
-         --with-sha1-asm)                 SHA1_ASM=YES               ;;
-@@ -418,6 +423,9 @@
-   --with-md5-opt=OPTIONS             set additional options for md5 building
-   --with-md5-asm                     use md5 assembler sources
- 
-+  --with-syslog                      use syslog instead of files to log messages
-+  --with-syslog-facility=FACILITY    set syslog facility
-+
-   --with-sha1=DIR                    set path to sha1 library sources
-   --with-sha1-opt=OPTIONS            set additional options for sha1 building
-   --with-sha1-asm                    use sha1 assembler sources
- 

Modified: trunk/www/nginx/files/nginx.in
===================================================================
--- trunk/www/nginx/files/nginx.in	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/nginx.in	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $MidnightBSD$
+# $FreeBSD: head/www/nginx/files/nginx.in 340872 2014-01-24 00:14:07Z mat $
 
 # PROVIDE: nginx
 # REQUIRE: LOGIN cleanvar

Modified: trunk/www/nginx/files/patch-conf-nginx.conf
===================================================================
--- trunk/www/nginx/files/patch-conf-nginx.conf	2016-03-04 04:58:22 UTC (rev 21048)
+++ trunk/www/nginx/files/patch-conf-nginx.conf	2016-03-04 23:15:31 UTC (rev 21049)
@@ -1,6 +1,3 @@
-
-$MidnightBSD$
-
 --- conf/nginx.conf.orig	Thu Jan 18 10:08:18 2007
 +++ conf/nginx.conf	Thu Jun 14 12:57:52 2007
 @@ -33,7 +33,7 @@



More information about the Midnightbsd-cvs mailing list