From 6c716b8886c2e2be4cee76e590e1e55c5bae8d1c Mon Sep 17 00:00:00 2001 From: Ycarus Date: Tue, 26 Jun 2018 12:10:00 +0200 Subject: [PATCH] Update to latest Nginx version --- nginx/Config.in | 19 ++++ nginx/Makefile | 99 +++++++++++++++++-- .../files-luci-support/60_nginx-luci-support | 26 +++++ .../70_nginx-luci-support-ssl | 46 +++++++++ nginx/files-luci-support/luci_nginx.conf | 55 +++++++++++ nginx/files-luci-support/luci_nginx_ssl.conf | 70 +++++++++++++ nginx/files-luci-support/luci_uwsgi.conf | 14 +++ .../100-no_by_lua_block.patch | 36 +++---- nginx/patches/101-feature_test_fix.patch | 18 ++-- nginx/patches/102-sizeof_test_fix.patch | 2 +- 10 files changed, 349 insertions(+), 36 deletions(-) create mode 100644 nginx/files-luci-support/60_nginx-luci-support create mode 100644 nginx/files-luci-support/70_nginx-luci-support-ssl create mode 100644 nginx/files-luci-support/luci_nginx.conf create mode 100644 nginx/files-luci-support/luci_nginx_ssl.conf create mode 100644 nginx/files-luci-support/luci_uwsgi.conf diff --git a/nginx/Config.in b/nginx/Config.in index 4cec04026..ebe0e567d 100644 --- a/nginx/Config.in +++ b/nginx/Config.in @@ -201,5 +201,24 @@ config NGINX_HTTP_SECURE_LINK bool prompt "Enable HTTP secure link module" default n + +config NGINX_HEADERS_MORE + bool + prompt "Enable Headers_more module" + help + Set and clear input and output headers...more than "add"! + default y + +config NGINX_HTTP_BROTLI + bool + prompt "Enable Brotli compression module" + help + Add support for brotli compression module. + default n + +config NGINX_STREAM + bool + prompt "Enable stream module" + default y endmenu diff --git a/nginx/Makefile b/nginx/Makefile index 9c7206c89..6330d0030 100644 --- a/nginx/Makefile +++ b/nginx/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nginx -PKG_VERSION:=1.12.2 -PKG_RELEASE:=1 +PKG_VERSION:=1.14.0 +PKG_RELEASE:=2 PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://nginx.org/download/ -PKG_HASH:=305f379da1d5fb5aefa79e45c829852ca6983c7cd2a79328f8e084a324cf0416 +PKG_HASH:=5d15becbf69aba1fe33f8d416d97edd95ea8919ea9ac519eff9bafebb6022cb5 + PKG_MAINTAINER:=Thomas Heil PKG_LICENSE:=2-clause BSD-like license @@ -57,10 +58,13 @@ PKG_CONFIG_DEPENDS := \ CONFIG_NGINX_HTTP_CACHE \ CONFIG_NGINX_HTTP_V2 \ CONFIG_NGINX_PCRE \ + CONFIG_NGINX_STREAM \ CONFIG_NGINX_NAXSI \ CONFIG_NGINX_LUA \ CONFIG_NGINX_HTTP_REAL_IP \ - CONFIG_NGINX_HTTP_SECURE_LINK + CONFIG_NGINX_HTTP_SECURE_LINK \ + CONFIG_NGINX_HTTP_BROTLI \ + CONFIG_NGINX_HEADERS_MORE include $(INCLUDE_DIR)/package.mk @@ -71,7 +75,6 @@ define Package/nginx TITLE:=Nginx web server URL:=http://nginx.org/ DEPENDS:=+NGINX_PCRE:libpcre +(NGINX_SSL||NGINX_HTTP_CACHE||NGINX_HTTP_AUTH_BASIC):libopenssl +NGINX_HTTP_GZIP:zlib +NGINX_LUA:liblua +libpthread - MENU:=1 endef define Package/nginx/description @@ -208,8 +211,43 @@ endif ifeq ($(CONFIG_NGINX_HTTP_SECURE_LINK),y) ADDITIONAL_MODULES += --with-http_secure_link_module endif +ifeq ($(CONFIG_NGINX_HEADERS_MORE),y) + ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-headers-more +endif +ifeq ($(CONFIG_NGINX_HTTP_BROTLI),y) + ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-brotli +endif +ifeq ($(CONFIG_NGINX_STREAM),y) + ADDITIONAL_MODULES += --with-stream +endif -TARGET_CFLAGS += -fvisibility=hidden -ffunction-sections -fdata-sections -DNGX_LUA_NO_BY_LUA_BLOCK -DNGX_HAVE_GCC_ATOMIC +define Package/nginx-mod-luci + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=Support file for Nginx + URL:=http://nginx.org/ + DEPENDS:=nginx +uwsgi-cgi +uwsgi-cgi-luci-support +endef + +define Package/nginx-mod-luci/description + Support file for LuCI in nginx (include custom nginx configuration, autostart script for uwsgi) +endef + +define Package/nginx-mod-luci-ssl + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=Support file for Nginx (SSL) + URL:=http://nginx.org/ + DEPENDS:=nginx +nginx-mod-luci +endef + +define Package/nginx-mod-luci-ssl/description + Support file for LuCI in nginx (include custom nginx configuration, autostart script for uwsgi, redirect from http to https) +endef + +TARGET_CFLAGS += -fvisibility=hidden -ffunction-sections -fdata-sections -DNGX_LUA_NO_BY_LUA_BLOCK TARGET_LDFLAGS += -Wl,--gc-sections define Build/Configure @@ -234,6 +272,21 @@ define Build/Configure ) endef +define Package/nginx-mod-luci/install + $(INSTALL_DIR) $(1)/etc/nginx + $(INSTALL_BIN) ./files-luci-support/luci_uwsgi.conf $(1)/etc/nginx/luci_uwsgi.conf + $(INSTALL_BIN) ./files-luci-support/luci_nginx.conf $(1)/etc/nginx/luci_nginx.conf + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files-luci-support/60_nginx-luci-support $(1)/etc/uci-defaults/60_nginx-luci-support +endef + +define Package/nginx-mod-luci-ssl/install + $(INSTALL_DIR) $(1)/etc/nginx + $(INSTALL_BIN) ./files-luci-support/luci_nginx_ssl.conf $(1)/etc/nginx/luci_nginx_ssl.conf + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files-luci-support/70_nginx-luci-support-ssl $(1)/etc/uci-defaults/70_nginx-luci-support-ssl +endef + define Package/nginx/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nginx $(1)/usr/sbin/ @@ -254,10 +307,38 @@ define Build/Prepare $(call Build/Prepare/Default) $(if $(CONFIG_NGINX_NAXSI),$(call Prepare/nginx-naxsi)) $(if $(CONFIG_NGINX_LUA),$(call Prepare/lua-nginx)) + $(if $(CONFIG_NGINX_HTTP_BROTLI),$(call Prepare/nginx-brotli)) + $(if $(CONFIG_NGINX_HEADERS_MORE),$(call Prepare/nginx-headers-more)) +endef + +define Download/nginx-headers-more + VERSION:=a9f7c7e86cc7441d04e2f11f01c2e3a9c4b0301d + SUBDIR:=nginx-headers-more + FILE:=headers-more-nginx-module-$(PKG_VERSION)-$$(VERSION).tar.gz + URL:=https://github.com/openresty/headers-more-nginx-module.git + PROTO:=git +endef + +define Prepare/nginx-headers-more + $(eval $(call Download,nginx-headers-more)) + gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS) +endef + +define Download/nginx-brotli + VERSION:=37ab9b2933a0b756ba3447000b7f31d432ed8228 + SUBDIR:=nginx-brotli + FILE:=ngx-brotli-module-$(PKG_VERSION)-$$(VERSION).tar.gz + URL:=https://github.com/eustas/ngx_brotli.git + PROTO:=git +endef + +define Prepare/nginx-brotli + $(eval $(call Download,nginx-brotli)) + gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS) endef define Download/nginx-naxsi - VERSION:=cf73f9c8664127252c2a4958d2e169516d3845a1 + VERSION:=fc4740f9734cabc1ce4c9d4cddc4b472eab1cc4b SUBDIR:=nginx-naxsi FILE:=nginx-naxsi-module-$(PKG_VERSION)-$$(VERSION).tar.gz URL:=https://github.com/nbs-system/naxsi.git @@ -270,7 +351,7 @@ define Prepare/nginx-naxsi endef define Download/lua-nginx - VERSION:=cdd2ae921f67bf396c743406493127be496e57ce + VERSION:=55743aeba3075b34a250380b32bad6366eae6c30 SUBDIR:=lua-nginx FILE:=lua-nginx-module-$(PKG_VERSION)-$$(VERSION).tar.gz URL:=https://github.com/openresty/lua-nginx-module.git @@ -284,3 +365,5 @@ define Prepare/lua-nginx endef $(eval $(call BuildPackage,nginx)) +$(eval $(call BuildPackage,nginx-mod-luci)) +$(eval $(call BuildPackage,nginx-mod-luci-ssl)) diff --git a/nginx/files-luci-support/60_nginx-luci-support b/nginx/files-luci-support/60_nginx-luci-support new file mode 100644 index 000000000..38a8aa885 --- /dev/null +++ b/nginx/files-luci-support/60_nginx-luci-support @@ -0,0 +1,26 @@ +#!/bin/sh + +if [ -f "/etc/nginx/luci_nginx.conf" ] && [ -f "/etc/nginx/nginx.conf" ]; then + if [ ! "$(cat '/etc/nginx/nginx.conf' | grep -q 'luci_uwsgi.conf')" ]; then + mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf_old + mv /etc/nginx/luci_nginx.conf /etc/nginx/nginx.conf + core_number=$(grep -c ^processor /proc/cpuinfo) + sed -i "3s/.*/worker_processes "$core_number";/" /etc/nginx/nginx.conf + if [ -n "$(pgrep uhttpd)" ]; then + /etc/init.d/uhttpd stop + /etc/init.d/uhttpd disable + fi + if [ -n "$(pgrep nginx)" ]; then + /etc/init.d/nginx restart + else + /etc/init.d/nginx start + fi + if [ -n "$(pgrep uwsgi)" ]; then + /etc/init.d/uwsgi restart + else + /etc/init.d/uwsgi start + fi + fi +fi + +exit 0 diff --git a/nginx/files-luci-support/70_nginx-luci-support-ssl b/nginx/files-luci-support/70_nginx-luci-support-ssl new file mode 100644 index 000000000..1cc1a85fc --- /dev/null +++ b/nginx/files-luci-support/70_nginx-luci-support-ssl @@ -0,0 +1,46 @@ +#!/bin/sh + + +if [ -f "/etc/nginx/luci_nginx_ssl.conf" ] && [ -f "/etc/nginx/nginx.conf" ]; then + if [ ! "$(cat '/etc/nginx/nginx.conf' | grep -q 'return 301 https://$host$request_uri;')" ]; then + if [ -f "/etc/nginx/nginx.conf_old" ]; then + rm /etc/nginx/nginx.conf + else + mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf_old + fi + mv /etc/nginx/luci_nginx_ssl.conf /etc/nginx/nginx.conf + core_number=$(grep -c ^processor /proc/cpuinfo) + sed -i "3s/.*/worker_processes "$core_number";/" /etc/nginx/nginx.conf + if [ -n "$(pgrep nginx)" ]; then + /etc/init.d/nginx restart + else + /etc/init.d/nginx start + fi + fi +fi + + +if [ ! -f "/etc/nginx/nginx.key" ]; then + + NGINX_KEY=/etc/nginx/nginx.key + NGINX_CER=/etc/nginx/nginx.cer + OPENSSL_BIN=/usr/bin/openssl + PX5G_BIN=/usr/sbin/px5g + + # Prefer px5g for certificate generation (existence evaluated last) + GENKEY_CMD="" + UNIQUEID=$(dd if=/dev/urandom bs=1 count=4 | hexdump -e '1/1 "%02x"') + [ -x "$OPENSSL_BIN" ] && GENKEY_CMD="$OPENSSL_BIN req -x509 -nodes" + [ -x "$PX5G_BIN" ] && GENKEY_CMD="$PX5G_BIN selfsigned" + [ -n "$GENKEY_CMD" ] && { + $GENKEY_CMD \ + -days 730 -newkey rsa:2048 -keyout "${NGINX_KEY}.new" -out "${NGINX_CER}.new" \ + -subj /C="ZZ"/ST="Somewhere"/L="Unknown"/O="OpenWrt""$UNIQUEID"/CN="OpenWrt" + sync + mv "${NGINX_KEY}.new" "${NGINX_KEY}" + mv "${NGINX_CER}.new" "${NGINX_CER}" + } +fi + + +exit 0 diff --git a/nginx/files-luci-support/luci_nginx.conf b/nginx/files-luci-support/luci_nginx.conf new file mode 100644 index 000000000..78f916b04 --- /dev/null +++ b/nginx/files-luci-support/luci_nginx.conf @@ -0,0 +1,55 @@ + +user root; +worker_processes 1; + +#error_log logs/error.log; +#error_log logs/error.log notice; +#error_log logs/error.log info; + +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include mime.types; + default_type application/octet-stream; + + sendfile on; + keepalive_timeout 0; + + client_body_buffer_size 10K; + client_header_buffer_size 1k; + client_max_body_size 1G; + large_client_header_buffers 2 1k; + + gzip on; + gzip_http_version 1.1; + gzip_vary on; + gzip_comp_level 1; + gzip_proxied any; + + root /www; + + server { + listen 80 default_server; + listen [::]:80 default_server; + server_name localhost; + + location ~* .(jpg|jpeg|png|gif|ico|css|js)$ { + expires 365d; + } + + location / { + index index.html; + include luci_uwsgi.conf; + } + + location /luci-static { + + } + } +} \ No newline at end of file diff --git a/nginx/files-luci-support/luci_nginx_ssl.conf b/nginx/files-luci-support/luci_nginx_ssl.conf new file mode 100644 index 000000000..4647fecbf --- /dev/null +++ b/nginx/files-luci-support/luci_nginx_ssl.conf @@ -0,0 +1,70 @@ + +user root; +worker_processes 1; + +#error_log logs/error.log; +#error_log logs/error.log notice; +#error_log logs/error.log info; + +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include mime.types; + default_type application/octet-stream; + + sendfile on; + keepalive_timeout 0; + + client_body_buffer_size 10K; + client_header_buffer_size 1k; + client_max_body_size 1G; + large_client_header_buffers 2 1k; + + gzip on; + gzip_http_version 1.1; + gzip_vary on; + gzip_comp_level 1; + gzip_proxied any; + + root /www; + + server { + listen 80 default_server; + listen [::]:80 default_server; + server_name _; + return 301 https://$host$request_uri; + } + + server { + listen 443 ssl default_server; + listen [::]:443 ssl default_server; + server_name localhost; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + ssl_ciphers "EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:DHE+AESGCM:DHE:!RSA!aNULL:!eNULL:!LOW:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!CAMELLIA:!SEED"; + ssl_session_tickets off; + + ssl_certificate /etc/nginx/nginx.cer; + ssl_certificate_key /etc/nginx/nginx.key; + + location ~* .(jpg|jpeg|png|gif|ico|css|js)$ { + expires 365d; + } + + location / { + index index.html; + include luci_uwsgi.conf; + } + + location /luci-static { + + } + } +} \ No newline at end of file diff --git a/nginx/files-luci-support/luci_uwsgi.conf b/nginx/files-luci-support/luci_uwsgi.conf new file mode 100644 index 000000000..eec66f4ad --- /dev/null +++ b/nginx/files-luci-support/luci_uwsgi.conf @@ -0,0 +1,14 @@ +uwsgi_param QUERY_STRING $query_string; +uwsgi_param REQUEST_METHOD $request_method; +uwsgi_param CONTENT_TYPE $content_type; +uwsgi_param CONTENT_LENGTH $content_length if_not_empty; +uwsgi_param REQUEST_URI $request_uri; +uwsgi_param PATH_INFO $document_uri; +uwsgi_param SERVER_PROTOCOL $server_protocol; +uwsgi_param REMOTE_ADDR $remote_addr; +uwsgi_param REMOTE_PORT $remote_port; +uwsgi_param SERVER_ADDR $server_addr; +uwsgi_param SERVER_PORT $server_port; +uwsgi_param SERVER_NAME $server_name; +uwsgi_modifier1 9; +uwsgi_pass unix:////var/run/uwsgi.sock; \ No newline at end of file diff --git a/nginx/patches-lua-nginx/100-no_by_lua_block.patch b/nginx/patches-lua-nginx/100-no_by_lua_block.patch index fef983fa7..968e12d58 100644 --- a/nginx/patches-lua-nginx/100-no_by_lua_block.patch +++ b/nginx/patches-lua-nginx/100-no_by_lua_block.patch @@ -1,6 +1,6 @@ --- a/lua-nginx/src/ngx_http_lua_module.c +++ b/lua-nginx/src/ngx_http_lua_module.c -@@ -157,14 +157,14 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -165,14 +165,14 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, offsetof(ngx_http_lua_loc_conf_t, log_socket_errors), NULL }, @@ -17,7 +17,7 @@ { ngx_string("init_by_lua"), NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, ngx_http_lua_init_by_lua, -@@ -178,14 +178,14 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -186,14 +186,14 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_MAIN_CONF_OFFSET, 0, (void *) ngx_http_lua_init_by_file }, @@ -34,7 +34,7 @@ { ngx_string("init_worker_by_lua"), NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, ngx_http_lua_init_worker_by_lua, -@@ -201,6 +201,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -209,6 +209,7 @@ static ngx_command_t ngx_http_lua_cmds[] (void *) ngx_http_lua_init_worker_by_file }, #if defined(NDK) && NDK @@ -42,7 +42,7 @@ /* set_by_lua $res { inline Lua code } [$arg1 [$arg2 [...]]] */ { ngx_string("set_by_lua_block"), NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF -@@ -209,7 +210,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -217,7 +218,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_filter_set_by_lua_inline }, @@ -51,7 +51,7 @@ /* set_by_lua $res [$arg1 [$arg2 [...]]] */ { ngx_string("set_by_lua"), NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF -@@ -237,7 +238,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -245,7 +246,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_rewrite_handler_inline }, @@ -60,7 +60,7 @@ /* rewrite_by_lua_block { } */ { ngx_string("rewrite_by_lua_block"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF -@@ -246,7 +247,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -254,7 +255,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_rewrite_handler_inline }, @@ -69,7 +69,7 @@ /* access_by_lua "" */ { ngx_string("access_by_lua"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF -@@ -255,7 +256,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -263,7 +264,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_access_handler_inline }, @@ -78,7 +78,7 @@ /* access_by_lua_block { } */ { ngx_string("access_by_lua_block"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF -@@ -264,7 +265,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -272,7 +273,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_access_handler_inline }, @@ -87,7 +87,7 @@ /* content_by_lua "" */ { ngx_string("content_by_lua"), NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, -@@ -272,7 +273,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -280,7 +281,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_content_handler_inline }, @@ -96,7 +96,7 @@ /* content_by_lua_block { } */ { ngx_string("content_by_lua_block"), NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, -@@ -280,7 +281,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -288,7 +289,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_content_handler_inline }, @@ -105,7 +105,7 @@ /* log_by_lua */ { ngx_string("log_by_lua"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF -@@ -289,7 +290,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -297,7 +298,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_log_handler_inline }, @@ -114,7 +114,7 @@ /* log_by_lua_block { } */ { ngx_string("log_by_lua_block"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF -@@ -298,7 +299,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -306,7 +307,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_log_handler_inline }, @@ -123,7 +123,7 @@ { ngx_string("rewrite_by_lua_file"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF |NGX_CONF_TAKE1, -@@ -353,7 +354,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -361,7 +362,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_header_filter_inline }, @@ -132,7 +132,7 @@ /* header_filter_by_lua_block { } */ { ngx_string("header_filter_by_lua_block"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF -@@ -362,7 +363,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -370,7 +371,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_header_filter_inline }, @@ -141,7 +141,7 @@ { ngx_string("header_filter_by_lua_file"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF |NGX_CONF_TAKE1, -@@ -378,7 +379,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -386,7 +387,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_body_filter_inline }, @@ -150,7 +150,7 @@ /* body_filter_by_lua_block { } */ { ngx_string("body_filter_by_lua_block"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF -@@ -387,7 +388,7 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -395,7 +396,7 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_body_filter_inline }, @@ -159,7 +159,7 @@ { ngx_string("body_filter_by_lua_file"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF |NGX_CONF_TAKE1, -@@ -395,14 +396,14 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -403,14 +404,14 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, 0, (void *) ngx_http_lua_body_filter_file }, @@ -176,7 +176,7 @@ { ngx_string("balancer_by_lua_file"), NGX_HTTP_UPS_CONF|NGX_CONF_TAKE1, ngx_http_lua_balancer_by_lua, -@@ -509,14 +510,14 @@ static ngx_command_t ngx_http_lua_cmds[] +@@ -517,14 +518,14 @@ static ngx_command_t ngx_http_lua_cmds[] NGX_HTTP_LOC_CONF_OFFSET, offsetof(ngx_http_lua_loc_conf_t, ssl_ciphers), NULL }, diff --git a/nginx/patches/101-feature_test_fix.patch b/nginx/patches/101-feature_test_fix.patch index 2c692bc79..930e7da98 100644 --- a/nginx/patches/101-feature_test_fix.patch +++ b/nginx/patches/101-feature_test_fix.patch @@ -11,7 +11,7 @@ ngx_feature_libs= --- a/auto/cc/conf +++ b/auto/cc/conf -@@ -200,7 +200,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then +@@ -204,7 +204,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then else ngx_feature="C99 variadic macros" ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS" @@ -20,7 +20,7 @@ ngx_feature_incs="#include #define var(dummy, ...) sprintf(__VA_ARGS__)" ngx_feature_path= -@@ -214,7 +214,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then +@@ -218,7 +218,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then ngx_feature="gcc variadic macros" ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS" @@ -40,7 +40,7 @@ ngx_feature_incs="#include " ngx_feature_path= ngx_feature_libs= -@@ -93,7 +93,7 @@ ngx_feature_test="int fd; struct stat sb +@@ -110,7 +110,7 @@ ngx_feature_test="int fd; struct stat sb CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE" ngx_feature="sendfile()" ngx_feature_name="NGX_HAVE_SENDFILE" @@ -49,7 +49,7 @@ ngx_feature_incs="#include #include " ngx_feature_path= -@@ -114,7 +114,7 @@ fi +@@ -131,7 +131,7 @@ fi CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" ngx_feature="sendfile64()" ngx_feature_name="NGX_HAVE_SENDFILE64" @@ -58,7 +58,7 @@ ngx_feature_incs="#include #include " ngx_feature_path= -@@ -132,7 +132,7 @@ ngx_include="sys/prctl.h"; . auto/includ +@@ -149,7 +149,7 @@ ngx_include="sys/prctl.h"; . auto/includ ngx_feature="prctl(PR_SET_DUMPABLE)" ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE" @@ -69,7 +69,7 @@ ngx_feature_libs= --- a/auto/unix +++ b/auto/unix -@@ -735,7 +735,7 @@ ngx_feature_test="void *p; p = memalign( +@@ -840,7 +840,7 @@ ngx_feature_test="void *p; p = memalign( ngx_feature="mmap(MAP_ANON|MAP_SHARED)" ngx_feature_name="NGX_HAVE_MAP_ANON" @@ -78,7 +78,7 @@ ngx_feature_incs="#include " ngx_feature_path= ngx_feature_libs= -@@ -748,7 +748,7 @@ ngx_feature_test="void *p; +@@ -853,7 +853,7 @@ ngx_feature_test="void *p; ngx_feature='mmap("/dev/zero", MAP_SHARED)' ngx_feature_name="NGX_HAVE_MAP_DEVZERO" @@ -87,7 +87,7 @@ ngx_feature_incs="#include #include #include " -@@ -763,7 +763,7 @@ ngx_feature_test='void *p; int fd; +@@ -868,7 +868,7 @@ ngx_feature_test='void *p; int fd; ngx_feature="System V shared memory" ngx_feature_name="NGX_HAVE_SYSVSHM" @@ -96,7 +96,7 @@ ngx_feature_incs="#include #include " ngx_feature_path= -@@ -777,7 +777,7 @@ ngx_feature_test="int id; +@@ -882,7 +882,7 @@ ngx_feature_test="int id; ngx_feature="POSIX semaphores" ngx_feature_name="NGX_HAVE_POSIX_SEM" diff --git a/nginx/patches/102-sizeof_test_fix.patch b/nginx/patches/102-sizeof_test_fix.patch index 8a0e88200..7d2430eab 100644 --- a/nginx/patches/102-sizeof_test_fix.patch +++ b/nginx/patches/102-sizeof_test_fix.patch @@ -16,7 +16,7 @@ return 0; } -@@ -40,7 +45,7 @@ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>& +@@ -40,7 +46,7 @@ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>& if [ -x $NGX_AUTOTEST ]; then