diff --git a/images/nginx/rootfs/build.sh b/images/nginx/rootfs/build.sh index 3baf775fca..1c82a4c7fb 100755 --- a/images/nginx/rootfs/build.sh +++ b/images/nginx/rootfs/build.sh @@ -18,7 +18,7 @@ set -o errexit set -o nounset set -o pipefail -export NGINX_VERSION=1.25.5 +export NGINX_VERSION=1.27.1 # Check for recent changes: https://github.com/vision5/ngx_devel_kit/compare/v0.3.3...master export NDK_VERSION=v0.3.3 @@ -44,32 +44,32 @@ export MODSECURITY_LIB_VERSION=v3.0.12 # Check for recent changes: https://github.com/coreruleset/coreruleset/compare/v3.3.5...v4.0/main export OWASP_MODSECURITY_CRS_VERSION=v4.4.0 -# Check for recent changes: https://github.com/openresty/lua-nginx-module/compare/v0.10.26``...master -export LUA_NGX_VERSION=v0.10.26 +# Check for recent changes: https://github.com/openresty/lua-nginx-module/compare/v0.10.27...master +export LUA_NGX_VERSION=v0.10.27 -# Check for recent changes: https://github.com/openresty/stream-lua-nginx-module/compare/bea8a0c0de94cede71554f53818ac0267d675d63...master -export LUA_STREAM_NGX_VERSION=bea8a0c0de94cede71554f53818ac0267d675d63 +# Check for recent changes: https://github.com/openresty/stream-lua-nginx-module/compare/v0.0.15...master +export LUA_STREAM_NGX_VERSION=v0.0.15 # Check for recent changes: https://github.com/openresty/lua-upstream-nginx-module/compare/8aa93ead98ba2060d4efd594ae33a35d153589bf...master export LUA_UPSTREAM_VERSION=542be0893543a4e42d89f6dd85372972f5ff2a36 -# Check for recent changes: https://github.com/openresty/lua-cjson/compare/2.1.0.13...openresty:master -export LUA_CJSON_VERSION=2.1.0.13 +# Check for recent changes: https://github.com/openresty/lua-cjson/compare/2.1.0.14...openresty:master +export LUA_CJSON_VERSION=2.1.0.14 # Check for recent changes: https://github.com/leev/ngx_http_geoip2_module/compare/a607a41a8115fecfc05b5c283c81532a3d605425...master export GEOIP2_VERSION=a607a41a8115fecfc05b5c283c81532a3d605425 -# Check for recent changes: https://github.com/openresty/luajit2/compare/v2.1-20240314...v2.1-agentzh -export LUAJIT_VERSION=v2.1-20240314 +# Check for recent changes: https://github.com/openresty/luajit2/compare/v2.1-20240815...master +export LUAJIT_VERSION=v2.1-20240815 # Check for recent changes: https://github.com/openresty/lua-resty-balancer/compare/1cd4363c0a239afe4765ec607dcfbbb4e5900eea...master export LUA_RESTY_BALANCER=1cd4363c0a239afe4765ec607dcfbbb4e5900eea -# Check for recent changes: https://github.com/openresty/lua-resty-lrucache/compare/99e7578465b40f36f596d099b82eab404f2b42ed...master -export LUA_RESTY_CACHE=99e7578465b40f36f596d099b82eab404f2b42ed +# Check for recent changes: https://github.com/openresty/lua-resty-lrucache/compare/v0.14...master +export LUA_RESTY_CACHE=v0.14 -# Check for recent changes: https://github.com/openresty/lua-resty-core/compare/v0.1.27...master -export LUA_RESTY_CORE=v0.1.28 +# Check for recent changes: https://github.com/openresty/lua-resty-core/compare/v0.1.29...master +export LUA_RESTY_CORE=v0.1.29 # Check for recent changes: https://github.com/cloudflare/lua-resty-cookie/compare/f418d77082eaef48331302e84330488fdc810ef4...master export LUA_RESTY_COOKIE_VERSION=f418d77082eaef48331302e84330488fdc810ef4 @@ -86,14 +86,14 @@ export LUA_RESTY_LOCK=405d0bf4cbfa74d742c6ed3158d442221e6212a9 # Check for recent changes: https://github.com/openresty/lua-resty-upload/compare/v0.11...master export LUA_RESTY_UPLOAD_VERSION=979372cce011f3176af3c9aff53fd0e992c4bfd3 -# Check for recent changes: https://github.com/openresty/lua-resty-string/compare/v0.15...master -export LUA_RESTY_STRING_VERSION=6f1bc21d86daef804df3cc34d6427ef68da26844 +# Check for recent changes: https://github.com/openresty/lua-resty-string/compare/v0.16...master +export LUA_RESTY_STRING_VERSION=v0.16 # Check for recent changes: https://github.com/openresty/lua-resty-memcached/compare/v0.17...master export LUA_RESTY_MEMCACHED_VERSION=2f02b68bf65fa2332cce070674a93a69a6c7239b -# Check for recent changes: https://github.com/openresty/lua-resty-redis/compare/v0.30...master -export LUA_RESTY_REDIS_VERSION=8641b9f1b6f75cca50c90cf8ca5c502ad8950aa8 +# Check for recent changes: https://github.com/openresty/lua-resty-redis/compare/v0.31...master +export LUA_RESTY_REDIS_VERSION=v0.31 # Check for recent changes: https://github.com/api7/lua-resty-ipmatcher/compare/v0.6.1...master export LUA_RESTY_IPMATCHER_VERSION=3e93c53eb8c9884efe939ef070486a0e507cc5be diff --git a/images/nginx/rootfs/patches/18_nginx-1.25.3-no_Werror.patch b/images/nginx/rootfs/patches/18_nginx-1.25.3-no_Werror.patch deleted file mode 100644 index f7176faffb..0000000000 --- a/images/nginx/rootfs/patches/18_nginx-1.25.3-no_Werror.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -urp nginx-1.25.3/auto/cc/clang nginx-1.25.3-patched/auto/cc/clang ---- nginx-1.25.3/auto/cc/clang 2014-03-04 03:39:24.000000000 -0800 -+++ nginx-1.25.3-patched/auto/cc/clang 2014-03-13 20:54:26.241413360 -0700 -@@ -89,7 +89,7 @@ CFLAGS="$CFLAGS -Wconditional-uninitiali - CFLAGS="$CFLAGS -Wno-unused-parameter" - - # stop on warning --CFLAGS="$CFLAGS -Werror" -+#CFLAGS="$CFLAGS -Werror" - - # debug - CFLAGS="$CFLAGS -g" -diff -urp nginx-1.25.3/auto/cc/gcc nginx-1.25.3-patched/auto/cc/gcc ---- nginx-1.25.3/auto/cc/gcc 2014-03-04 03:39:24.000000000 -0800 -+++ nginx-1.25.3-patched/auto/cc/gcc 2014-03-13 20:54:13.301355329 -0700 -@@ -168,7 +168,7 @@ esac - - - # stop on warning --CFLAGS="$CFLAGS -Werror" -+#CFLAGS="$CFLAGS -Werror" - - # debug - CFLAGS="$CFLAGS -g" -diff -urp nginx-1.25.3/auto/cc/icc nginx-1.25.3-patched/auto/cc/icc ---- nginx-1.25.3/auto/cc/icc 2014-03-04 03:39:24.000000000 -0800 -+++ nginx-1.25.3-patched/auto/cc/icc 2014-03-13 20:54:13.301355329 -0700 -@@ -115,7 +115,7 @@ case "$NGX_ICC_VER" in - esac - - # stop on warning --CFLAGS="$CFLAGS -Werror" -+#CFLAGS="$CFLAGS -Werror" - - # debug - CFLAGS="$CFLAGS -g" diff --git a/images/nginx/rootfs/patches/24_nginx-1.25.3-always_enable_cc_feature_tests.patch b/images/nginx/rootfs/patches/nginx-1.27.1-always_enable_cc_feature_tests.patch similarity index 65% rename from images/nginx/rootfs/patches/24_nginx-1.25.3-always_enable_cc_feature_tests.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-always_enable_cc_feature_tests.patch index b381d9b07b..9517e92c46 100644 --- a/images/nginx/rootfs/patches/24_nginx-1.25.3-always_enable_cc_feature_tests.patch +++ b/images/nginx/rootfs/patches/nginx-1.27.1-always_enable_cc_feature_tests.patch @@ -1,5 +1,5 @@ ---- nginx-1.25.3/auto/cc/conf 2015-10-30 22:47:50.000000000 +0800 -+++ nginx-1.25.3-patched/auto/cc/conf 2015-11-02 12:23:05.385156987 +0800 +--- nginx-1.27.1/auto/cc/conf 2015-10-30 22:47:50.000000000 +0800 ++++ nginx-1.27.1-patched/auto/cc/conf 2015-11-02 12:23:05.385156987 +0800 @@ -144,7 +144,7 @@ fi CFLAGS="$CFLAGS $NGX_CC_OPT" NGX_TEST_LD_OPT="$NGX_LD_OPT" diff --git a/images/nginx/rootfs/patches/nginx-1.27.1-balancer_pool_max_retry.patch b/images/nginx/rootfs/patches/nginx-1.27.1-balancer_pool_max_retry.patch new file mode 100644 index 0000000000..8ee44ea9b5 --- /dev/null +++ b/images/nginx/rootfs/patches/nginx-1.27.1-balancer_pool_max_retry.patch @@ -0,0 +1,27 @@ +diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c +index d04d91e..397cb08 100644 +--- a/src/http/ngx_http_upstream.c ++++ b/src/http/ngx_http_upstream.c +@@ -4378,6 +4378,9 @@ ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u, + if (u->peer.cached && ft_type == NGX_HTTP_UPSTREAM_FT_ERROR) { + /* TODO: inform balancer instead */ + u->peer.tries++; ++ if (u->peer.notify) { ++ u->peer.notify(&u->peer, u->peer.data, NGX_HTTP_UPSTREAM_NOTIFY_CACHED_CONNECTION_ERROR); ++ } + } + + switch (ft_type) { +diff --git a/src/http/ngx_http_upstream.h b/src/http/ngx_http_upstream.h +index f6621af..2b5957e 100644 +--- a/src/http/ngx_http_upstream.h ++++ b/src/http/ngx_http_upstream.h +@@ -55,6 +55,8 @@ + #define NGX_HTTP_UPSTREAM_IGN_XA_CHARSET 0x00000100 + #define NGX_HTTP_UPSTREAM_IGN_VARY 0x00000200 + ++#define NGX_HTTP_UPSTREAM_NOTIFY_CACHED_CONNECTION_ERROR 0x1 ++ + + typedef struct { + ngx_uint_t status; diff --git a/images/nginx/rootfs/patches/09_nginx-1.25.3-balancer_status_code.patch b/images/nginx/rootfs/patches/nginx-1.27.1-balancer_status_code.patch similarity index 100% rename from images/nginx/rootfs/patches/09_nginx-1.25.3-balancer_status_code.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-balancer_status_code.patch diff --git a/images/nginx/rootfs/patches/nginx-1.27.1-builtin_error_page_footer.patch b/images/nginx/rootfs/patches/nginx-1.27.1-builtin_error_page_footer.patch new file mode 100644 index 0000000000..2212ab459b --- /dev/null +++ b/images/nginx/rootfs/patches/nginx-1.27.1-builtin_error_page_footer.patch @@ -0,0 +1,13 @@ +diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c +index 64e5acd..f5374f6 100644 +--- a/src/http/ngx_http_special_response.c ++++ b/src/http/ngx_http_special_response.c +@@ -26,7 +26,7 @@ static u_char ngx_http_error_full_tail[] = + + + static u_char ngx_http_error_tail[] = +-"
nginx
" CRLF ++"
openresty
" CRLF + "" CRLF + "" CRLF + ; diff --git a/images/nginx/rootfs/patches/21_nginx-1.25.3-cache_manager_exit.patch b/images/nginx/rootfs/patches/nginx-1.27.1-cache_manager_exit.patch similarity index 100% rename from images/nginx/rootfs/patches/21_nginx-1.25.3-cache_manager_exit.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-cache_manager_exit.patch diff --git a/images/nginx/rootfs/patches/07_nginx-1.25.3-daemon_destroy_pool.patch b/images/nginx/rootfs/patches/nginx-1.27.1-daemon_destroy_pool.patch similarity index 100% rename from images/nginx/rootfs/patches/07_nginx-1.25.3-daemon_destroy_pool.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-daemon_destroy_pool.patch diff --git a/images/nginx/rootfs/patches/10_nginx-1.25.3-delayed_posted_events.patch b/images/nginx/rootfs/patches/nginx-1.27.1-delayed_posted_events.patch similarity index 100% rename from images/nginx/rootfs/patches/10_nginx-1.25.3-delayed_posted_events.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-delayed_posted_events.patch diff --git a/images/nginx/rootfs/patches/nginx-1.27.1-hash_overflow.patch b/images/nginx/rootfs/patches/nginx-1.27.1-hash_overflow.patch new file mode 100644 index 0000000000..449d214bab --- /dev/null +++ b/images/nginx/rootfs/patches/nginx-1.27.1-hash_overflow.patch @@ -0,0 +1,20 @@ +# HG changeset patch +# User Yichun Zhang +# Date 1412276417 25200 +# Thu Oct 02 12:00:17 2014 -0700 +# Node ID 4032b992f23b054c1a2cfb0be879330d2c6708e5 +# Parent 1ff0f68d9376e3d184d65814a6372856bf65cfcd +Hash: buffer overflow might happen when exceeding the pre-configured limits. + +diff -r 1ff0f68d9376 -r 4032b992f23b src/core/ngx_hash.c +--- a/src/core/ngx_hash.c Tue Sep 30 15:50:28 2014 -0700 ++++ b/src/core/ngx_hash.c Thu Oct 02 12:00:17 2014 -0700 +@@ -312,6 +312,8 @@ ngx_hash_init(ngx_hash_init_t *hinit, ng + continue; + } + ++ size--; ++ + ngx_log_error(NGX_LOG_WARN, hinit->pool->log, 0, + "could not build optimal %s, you should increase " + "either %s_max_size: %i or %s_bucket_size: %i; " diff --git a/images/nginx/rootfs/patches/08_nginx-1.25.3-init_cycle_pool_release.patch b/images/nginx/rootfs/patches/nginx-1.27.1-init_cycle_pool_release.patch similarity index 65% rename from images/nginx/rootfs/patches/08_nginx-1.25.3-init_cycle_pool_release.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-init_cycle_pool_release.patch index bd2e9a7d92..4a26b92c59 100644 --- a/images/nginx/rootfs/patches/08_nginx-1.25.3-init_cycle_pool_release.patch +++ b/images/nginx/rootfs/patches/nginx-1.27.1-init_cycle_pool_release.patch @@ -1,6 +1,6 @@ -diff -rup nginx-1.25.3/src/core/nginx.c nginx-1.25.3-patched/src/core/nginx.c ---- nginx-1.25.3/src/core/nginx.c 2017-12-17 00:00:38.136470108 -0800 -+++ nginx-1.25.3-patched/src/core/nginx.c 2017-12-16 23:59:51.680958322 -0800 +diff -rup nginx-1.27.1/src/core/nginx.c nginx-1.27.1-patched/src/core/nginx.c +--- nginx-1.27.1/src/core/nginx.c 2017-12-17 00:00:38.136470108 -0800 ++++ nginx-1.27.1-patched/src/core/nginx.c 2017-12-16 23:59:51.680958322 -0800 @@ -186,6 +186,7 @@ static u_char *ngx_prefix; static u_char *ngx_conf_file; static u_char *ngx_conf_params; @@ -18,9 +18,9 @@ diff -rup nginx-1.25.3/src/core/nginx.c nginx-1.25.3-patched/src/core/nginx.c if (ngx_save_argv(&init_cycle, argc, argv) != NGX_OK) { return 1; } -diff -rup nginx-1.25.3/src/core/ngx_core.h nginx-1.25.3-patched/src/core/ngx_core.h ---- nginx-1.25.3/src/core/ngx_core.h 2017-10-10 08:22:51.000000000 -0700 -+++ nginx-1.25.3-patched/src/core/ngx_core.h 2017-12-16 23:59:51.679958370 -0800 +diff -rup nginx-1.27.1/src/core/ngx_core.h nginx-1.27.1-patched/src/core/ngx_core.h +--- nginx-1.27.1/src/core/ngx_core.h 2017-10-10 08:22:51.000000000 -0700 ++++ nginx-1.27.1-patched/src/core/ngx_core.h 2017-12-16 23:59:51.679958370 -0800 @@ -108,4 +108,6 @@ void ngx_cpuinfo(void); #define NGX_DISABLE_SYMLINKS_NOTOWNER 2 #endif @@ -28,9 +28,9 @@ diff -rup nginx-1.25.3/src/core/ngx_core.h nginx-1.25.3-patched/src/core/ngx_cor +extern ngx_pool_t *saved_init_cycle_pool; + #endif /* _NGX_CORE_H_INCLUDED_ */ -diff -rup nginx-1.25.3/src/core/ngx_cycle.c nginx-1.25.3-patched/src/core/ngx_cycle.c ---- nginx-1.25.3/src/core/ngx_cycle.c 2017-10-10 08:22:51.000000000 -0700 -+++ nginx-1.25.3-patched/src/core/ngx_cycle.c 2017-12-16 23:59:51.678958419 -0800 +diff -rup nginx-1.27.1/src/core/ngx_cycle.c nginx-1.27.1-patched/src/core/ngx_cycle.c +--- nginx-1.27.1/src/core/ngx_cycle.c 2017-10-10 08:22:51.000000000 -0700 ++++ nginx-1.27.1-patched/src/core/ngx_cycle.c 2017-12-16 23:59:51.678958419 -0800 @@ -748,6 +748,10 @@ old_shm_zone_done: if (ngx_process == NGX_PROCESS_MASTER || ngx_is_init_cycle(old_cycle)) { @@ -42,9 +42,9 @@ diff -rup nginx-1.25.3/src/core/ngx_cycle.c nginx-1.25.3-patched/src/core/ngx_cy ngx_destroy_pool(old_cycle->pool); cycle->old_cycle = NULL; -diff -rup nginx-1.25.3/src/os/unix/ngx_process_cycle.c nginx-1.25.3-patched/src/os/unix/ngx_process_cycle.c ---- nginx-1.25.3/src/os/unix/ngx_process_cycle.c 2017-12-17 00:00:38.142469762 -0800 -+++ nginx-1.25.3-patched/src/os/unix/ngx_process_cycle.c 2017-12-16 23:59:51.691957791 -0800 +diff -rup nginx-1.27.1/src/os/unix/ngx_process_cycle.c nginx-1.27.1-patched/src/os/unix/ngx_process_cycle.c +--- nginx-1.27.1/src/os/unix/ngx_process_cycle.c 2017-12-17 00:00:38.142469762 -0800 ++++ nginx-1.27.1-patched/src/os/unix/ngx_process_cycle.c 2017-12-16 23:59:51.691957791 -0800 @@ -687,6 +692,11 @@ ngx_master_process_exit(ngx_cycle_t *cyc ngx_exit_cycle.files_n = ngx_cycle->files_n; ngx_cycle = &ngx_exit_cycle; diff --git a/images/nginx/rootfs/patches/nginx-1.27.1-initialize_quic_transport_id_variable.patch b/images/nginx/rootfs/patches/nginx-1.27.1-initialize_quic_transport_id_variable.patch new file mode 100644 index 0000000000..ea7b1e9362 --- /dev/null +++ b/images/nginx/rootfs/patches/nginx-1.27.1-initialize_quic_transport_id_variable.patch @@ -0,0 +1,11 @@ +--- nginx-1.27.1/src/event/quic/ngx_event_quic_transport.c 2024-08-06 16:52:18.545250210 +0800 ++++ nginx-1.27.1-patched/src/event/quic/ngx_event_quic_transport.c 2024-08-06 16:52:29.691035755 +0800 +@@ -1720,7 +1720,7 @@ + ngx_quic_parse_transport_params(u_char *p, u_char *end, ngx_quic_tp_t *tp, + ngx_log_t *log) + { +- uint64_t id, len; ++ uint64_t id = 0, len; + ngx_int_t rc; + + while (p < end) { diff --git a/images/nginx/rootfs/patches/15_nginx-1.25.3-intercept_error_log.patch b/images/nginx/rootfs/patches/nginx-1.27.1-intercept_error_log.patch similarity index 100% rename from images/nginx/rootfs/patches/15_nginx-1.25.3-intercept_error_log.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-intercept_error_log.patch diff --git a/images/nginx/rootfs/patches/22_nginx-1.25.3-larger_max_error_str.patch b/images/nginx/rootfs/patches/nginx-1.27.1-larger_max_error_str.patch similarity index 62% rename from images/nginx/rootfs/patches/22_nginx-1.25.3-larger_max_error_str.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-larger_max_error_str.patch index e5cd07e678..b821297e63 100644 --- a/images/nginx/rootfs/patches/22_nginx-1.25.3-larger_max_error_str.patch +++ b/images/nginx/rootfs/patches/nginx-1.27.1-larger_max_error_str.patch @@ -1,5 +1,5 @@ ---- nginx-1.25.3/src/core/ngx_log.h 2013-10-08 05:07:14.000000000 -0700 -+++ nginx-1.25.3-patched/src/core/ngx_log.h 2013-12-05 20:35:35.996236720 -0800 +--- nginx-1.27.1/src/core/ngx_log.h 2013-10-08 05:07:14.000000000 -0700 ++++ nginx-1.27.1-patched/src/core/ngx_log.h 2013-12-05 20:35:35.996236720 -0800 @@ -64,7 +64,9 @@ struct ngx_log_s { }; diff --git a/images/nginx/rootfs/patches/19_nginx-1.25.3-log_escape_non_ascii.patch b/images/nginx/rootfs/patches/nginx-1.27.1-log_escape_non_ascii.patch similarity index 100% rename from images/nginx/rootfs/patches/19_nginx-1.25.3-log_escape_non_ascii.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-log_escape_non_ascii.patch diff --git a/images/nginx/rootfs/patches/nginx-1.27.1-no_Werror.patch b/images/nginx/rootfs/patches/nginx-1.27.1-no_Werror.patch new file mode 100644 index 0000000000..d0aa7a31ed --- /dev/null +++ b/images/nginx/rootfs/patches/nginx-1.27.1-no_Werror.patch @@ -0,0 +1,36 @@ +diff -urp nginx-1.27.1/auto/cc/clang nginx-1.27.1-patched/auto/cc/clang +--- nginx-1.27.1/auto/cc/clang 2014-03-04 03:39:24.000000000 -0800 ++++ nginx-1.27.1-patched/auto/cc/clang 2014-03-13 20:54:26.241413360 -0700 +@@ -89,7 +89,7 @@ CFLAGS="$CFLAGS -Wconditional-uninitiali + CFLAGS="$CFLAGS -Wno-unused-parameter" + + # stop on warning +-CFLAGS="$CFLAGS -Werror" ++#CFLAGS="$CFLAGS -Werror" + + # debug + CFLAGS="$CFLAGS -g" +diff -urp nginx-1.27.1/auto/cc/gcc nginx-1.27.1-patched/auto/cc/gcc +--- nginx-1.27.1/auto/cc/gcc 2014-03-04 03:39:24.000000000 -0800 ++++ nginx-1.27.1-patched/auto/cc/gcc 2014-03-13 20:54:13.301355329 -0700 +@@ -168,7 +168,7 @@ esac + + + # stop on warning +-CFLAGS="$CFLAGS -Werror" ++#CFLAGS="$CFLAGS -Werror" + + # debug + CFLAGS="$CFLAGS -g" +diff -urp nginx-1.27.1/auto/cc/icc nginx-1.27.1-patched/auto/cc/icc +--- nginx-1.27.1/auto/cc/icc 2014-03-04 03:39:24.000000000 -0800 ++++ nginx-1.27.1-patched/auto/cc/icc 2014-03-13 20:54:13.301355329 -0700 +@@ -115,7 +115,7 @@ case "$NGX_ICC_VER" in + esac + + # stop on warning +-CFLAGS="$CFLAGS -Werror" ++#CFLAGS="$CFLAGS -Werror" + + # debug + CFLAGS="$CFLAGS -g" diff --git a/images/nginx/rootfs/patches/17_nginx-1.25.3-no_error_pages.patch b/images/nginx/rootfs/patches/nginx-1.27.1-no_error_pages.patch similarity index 93% rename from images/nginx/rootfs/patches/17_nginx-1.25.3-no_error_pages.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-no_error_pages.patch index aceb2e9884..593fcefd6c 100644 --- a/images/nginx/rootfs/patches/17_nginx-1.25.3-no_error_pages.patch +++ b/images/nginx/rootfs/patches/nginx-1.27.1-no_error_pages.patch @@ -1,6 +1,6 @@ -diff -upr nginx-1.25.3/src/http/ngx_http_core_module.c nginx-1.25.3-patched/src/http/ngx_http_core_module.c ---- nginx-1.25.3/src/http/ngx_http_core_module.c 2017-08-31 18:14:41.000000000 -0700 -+++ nginx-1.25.3-patched/src/http/ngx_http_core_module.c 2017-08-31 18:21:31.638098196 -0700 +diff -upr nginx-1.27.1/src/http/ngx_http_core_module.c nginx-1.27.1-patched/src/http/ngx_http_core_module.c +--- nginx-1.27.1/src/http/ngx_http_core_module.c 2017-08-31 18:14:41.000000000 -0700 ++++ nginx-1.27.1-patched/src/http/ngx_http_core_module.c 2017-08-31 18:21:31.638098196 -0700 @@ -64,6 +64,8 @@ static char *ngx_http_core_directio(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static char *ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, diff --git a/images/nginx/rootfs/patches/nginx-1.27.1-no_pool.patch b/images/nginx/rootfs/patches/nginx-1.27.1-no_pool.patch new file mode 100644 index 0000000000..886059d9bb --- /dev/null +++ b/images/nginx/rootfs/patches/nginx-1.27.1-no_pool.patch @@ -0,0 +1,587 @@ +diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.27.1/src/core/nginx.h nginx-1.27.1-patched/src/core/nginx.h +--- nginx-1.27.1/src/core/nginx.h 2016-04-19 09:02:38.000000000 -0700 ++++ nginx-1.27.1-patched/src/core/nginx.h 2016-04-21 16:25:07.452944624 -0700 +@@ -10,7 +10,7 @@ + + + #define nginx_version 1027001 + #define NGINX_VERSION "1.27.1" +-#define NGINX_VER "openresty/" NGINX_VERSION ".unknown" ++#define NGINX_VER "openresty/" NGINX_VERSION ".unknown (no pool)" + + #ifdef NGX_BUILD +diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.27.1/src/core/ngx_array.c nginx-1.27.1-patched/src/core/ngx_array.c +--- nginx-1.27.1/src/core/ngx_array.c 2016-04-19 09:02:38.000000000 -0700 ++++ nginx-1.27.1-patched/src/core/ngx_array.c 2016-04-21 16:25:07.453947190 -0700 +@@ -30,26 +30,30 @@ ngx_array_create(ngx_pool_t *p, ngx_uint + void + ngx_array_destroy(ngx_array_t *a) + { +- ngx_pool_t *p; ++ ngx_pool_t *p; ++ ngx_array_link_t *link; + + p = a->pool; + +- if ((u_char *) a->elts + a->size * a->nalloc == p->d.last) { +- p->d.last -= a->size * a->nalloc; ++ if (a->elts) { ++ ngx_pfree(p, a->elts); + } + +- if ((u_char *) a + sizeof(ngx_array_t) == p->d.last) { +- p->d.last = (u_char *) a; ++ for (link = a->old_elts; link; link = link->next) { ++ ngx_pfree(p, link->elts); + } ++ ++ ngx_pfree(p, a); + } + + + void * + ngx_array_push(ngx_array_t *a) + { +- void *elt, *new; +- size_t size; +- ngx_pool_t *p; ++ void *elt, *new; ++ size_t size; ++ ngx_pool_t *p; ++ ngx_array_link_t *link; + + if (a->nelts == a->nalloc) { + +@@ -59,29 +63,27 @@ ngx_array_push(ngx_array_t *a) + + p = a->pool; + +- if ((u_char *) a->elts + size == p->d.last +- && p->d.last + a->size <= p->d.end) +- { +- /* +- * the array allocation is the last in the pool +- * and there is space for new allocation +- */ +- +- p->d.last += a->size; +- a->nalloc++; ++ /* allocate a new array */ + +- } else { +- /* allocate a new array */ ++ new = ngx_palloc(p, 2 * size); ++ if (new == NULL) { ++ return NULL; ++ } + +- new = ngx_palloc(p, 2 * size); +- if (new == NULL) { +- return NULL; +- } ++ ngx_memcpy(new, a->elts, size); + +- ngx_memcpy(new, a->elts, size); +- a->elts = new; +- a->nalloc *= 2; ++ link = ngx_palloc(p, sizeof(ngx_array_link_t)); ++ if (link == NULL) { ++ ngx_pfree(p, new); ++ return NULL; + } ++ ++ link->next = a->old_elts; ++ link->elts = a->elts; ++ a->old_elts = link; ++ ++ a->elts = new; ++ a->nalloc *= 2; + } + + elt = (u_char *) a->elts + a->size * a->nelts; +@@ -95,11 +97,10 @@ void * + ngx_array_push_n(ngx_array_t *a, ngx_uint_t n) + { + void *elt, *new; +- size_t size; + ngx_uint_t nalloc; + ngx_pool_t *p; + +- size = n * a->size; ++ ngx_array_link_t *link; + + if (a->nelts + n > a->nalloc) { + +@@ -107,31 +108,27 @@ ngx_array_push_n(ngx_array_t *a, ngx_uin + + p = a->pool; + +- if ((u_char *) a->elts + a->size * a->nalloc == p->d.last +- && p->d.last + size <= p->d.end) +- { +- /* +- * the array allocation is the last in the pool +- * and there is space for new allocation +- */ ++ nalloc = 2 * ((n >= a->nalloc) ? n : a->nalloc); + +- p->d.last += size; +- a->nalloc += n; ++ new = ngx_palloc(p, nalloc * a->size); ++ if (new == NULL) { ++ return NULL; ++ } + +- } else { +- /* allocate a new array */ ++ ngx_memcpy(new, a->elts, a->nelts * a->size); + +- nalloc = 2 * ((n >= a->nalloc) ? n : a->nalloc); ++ link = ngx_palloc(p, sizeof(ngx_array_link_t)); ++ if (link == NULL) { ++ ngx_pfree(p, new); ++ return NULL; ++ } + +- new = ngx_palloc(p, nalloc * a->size); +- if (new == NULL) { +- return NULL; +- } ++ link->next = a->old_elts; ++ link->elts = a->elts; ++ a->old_elts = link; + +- ngx_memcpy(new, a->elts, a->nelts * a->size); +- a->elts = new; +- a->nalloc = nalloc; +- } ++ a->elts = new; ++ a->nalloc = nalloc; + } + + elt = (u_char *) a->elts + a->size * a->nelts; +diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.27.1/src/core/ngx_array.h nginx-1.27.1-patched/src/core/ngx_array.h +--- nginx-1.27.1/src/core/ngx_array.h 2016-04-19 09:02:38.000000000 -0700 ++++ nginx-1.27.1-patched/src/core/ngx_array.h 2016-04-21 16:25:07.453947190 -0700 +@@ -13,12 +13,23 @@ + #include + + ++typedef struct ngx_array_link_s ngx_array_link_t; ++ ++ ++struct ngx_array_link_s { ++ void *elts; ++ ngx_array_link_t *next; ++}; ++ ++ + typedef struct { + void *elts; + ngx_uint_t nelts; + size_t size; + ngx_uint_t nalloc; + ngx_pool_t *pool; ++ ++ ngx_array_link_t *old_elts; + } ngx_array_t; + + +@@ -40,6 +51,7 @@ ngx_array_init(ngx_array_t *array, ngx_p + array->size = size; + array->nalloc = n; + array->pool = pool; ++ array->old_elts = NULL; + + array->elts = ngx_palloc(pool, n * size); + if (array->elts == NULL) { +diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.27.1/src/core/ngx_palloc.c nginx-1.27.1-patched/src/core/ngx_palloc.c +--- nginx-1.27.1/src/core/ngx_palloc.c 2016-04-19 09:02:38.000000000 -0700 ++++ nginx-1.27.1-patched/src/core/ngx_palloc.c 2016-04-21 16:25:45.912282685 -0700 +@@ -9,34 +9,26 @@ + #include + + +-static ngx_inline void *ngx_palloc_small(ngx_pool_t *pool, size_t size, +- ngx_uint_t align); +-static void *ngx_palloc_block(ngx_pool_t *pool, size_t size); +-static void *ngx_palloc_large(ngx_pool_t *pool, size_t size); ++static void * ngx_malloc(ngx_pool_t *pool, size_t size); + + + ngx_pool_t * + ngx_create_pool(size_t size, ngx_log_t *log) + { +- ngx_pool_t *p; ++ ngx_pool_t *p; + +- p = ngx_memalign(NGX_POOL_ALIGNMENT, size, log); ++ size = sizeof(ngx_pool_t); ++ p = ngx_alloc(size, log); + if (p == NULL) { + return NULL; + } + +- p->d.last = (u_char *) p + sizeof(ngx_pool_t); +- p->d.end = (u_char *) p + size; +- p->d.next = NULL; +- p->d.failed = 0; ++ ngx_memzero(p, size); + + size = size - sizeof(ngx_pool_t); + p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL; + + p->current = p; +- p->chain = NULL; +- p->large = NULL; +- p->cleanup = NULL; + p->log = log; + + return p; +@@ -46,8 +38,7 @@ ngx_create_pool(size_t size, ngx_log_t * + void + ngx_destroy_pool(ngx_pool_t *pool) + { +- ngx_pool_t *p, *n; +- ngx_pool_large_t *l; ++ ngx_pool_data_t *d, *n; + ngx_pool_cleanup_t *c; + + for (c = pool->cleanup; c; c = c->next) { +@@ -58,6 +49,11 @@ ngx_destroy_pool(ngx_pool_t *pool) + } + } + ++ if (pool->d == NULL) { ++ ngx_free(pool); ++ return; ++ } ++ + #if (NGX_DEBUG) + + /* +@@ -65,13 +61,9 @@ ngx_destroy_pool(ngx_pool_t *pool) + * so we cannot use this log while free()ing the pool + */ + +- for (l = pool->large; l; l = l->next) { +- ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, pool->log, 0, "free: %p", l->alloc); +- } +- +- for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) { ++ for (d = pool->d, n = d->next; ; d = n, n = n->next) { + ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, pool->log, 0, +- "free: %p, unused: %uz", p, p->d.end - p->d.last); ++ "free: %p, unused: %d", d, 0); + + if (n == NULL) { + break; +@@ -80,171 +72,82 @@ ngx_destroy_pool(ngx_pool_t *pool) + + #endif + +- for (l = pool->large; l; l = l->next) { +- if (l->alloc) { +- ngx_free(l->alloc); +- } +- } +- +- for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) { +- ngx_free(p); ++ for (d = pool->d, n = d->next; ; d = n, n = n->next) { ++ ngx_free(d->alloc); ++ ngx_free(d); + + if (n == NULL) { + break; + } + } ++ ++ pool->d = NULL; ++ ngx_free(pool); + } + + + void + ngx_reset_pool(ngx_pool_t *pool) + { +- ngx_pool_t *p; +- ngx_pool_large_t *l; ++ ngx_pool_data_t *d, *n; ++ ngx_pool_data_t *saved = NULL; + +- for (l = pool->large; l; l = l->next) { +- if (l->alloc) { +- ngx_free(l->alloc); ++ if (pool->d) { ++ for (d = pool->d, n = d->next; ; d = n, n = n->next) { ++ if (d->alloc == pool->log) { ++ saved = d; ++ continue; ++ } ++ ++ ngx_free(d->alloc); ++ ngx_free(d); ++ ++ if (n == NULL) { ++ break; ++ } + } +- } + +- for (p = pool; p; p = p->d.next) { +- p->d.last = (u_char *) p + sizeof(ngx_pool_t); +- p->d.failed = 0; ++ pool->d = saved; ++ pool->current = pool; ++ pool->chain = NULL; + } +- +- pool->current = pool; +- pool->chain = NULL; +- pool->large = NULL; + } + + + void * + ngx_palloc(ngx_pool_t *pool, size_t size) + { +-#if !(NGX_DEBUG_PALLOC) +- if (size <= pool->max) { +- return ngx_palloc_small(pool, size, 1); +- } +-#endif +- +- return ngx_palloc_large(pool, size); ++ return ngx_malloc(pool, size); + } + + + void * + ngx_pnalloc(ngx_pool_t *pool, size_t size) + { +-#if !(NGX_DEBUG_PALLOC) +- if (size <= pool->max) { +- return ngx_palloc_small(pool, size, 0); +- } +-#endif +- +- return ngx_palloc_large(pool, size); +-} +- +- +-static ngx_inline void * +-ngx_palloc_small(ngx_pool_t *pool, size_t size, ngx_uint_t align) +-{ +- u_char *m; +- ngx_pool_t *p; +- +- p = pool->current; +- +- do { +- m = p->d.last; +- +- if (align) { +- m = ngx_align_ptr(m, NGX_ALIGNMENT); +- } +- +- if ((size_t) (p->d.end - m) >= size) { +- p->d.last = m + size; +- +- return m; +- } +- +- p = p->d.next; +- +- } while (p); +- +- return ngx_palloc_block(pool, size); +-} +- +- +-static void * +-ngx_palloc_block(ngx_pool_t *pool, size_t size) +-{ +- u_char *m; +- size_t psize; +- ngx_pool_t *p, *new; +- +- psize = (size_t) (pool->d.end - (u_char *) pool); +- +- m = ngx_memalign(NGX_POOL_ALIGNMENT, psize, pool->log); +- if (m == NULL) { +- return NULL; +- } +- +- new = (ngx_pool_t *) m; +- +- new->d.end = m + psize; +- new->d.next = NULL; +- new->d.failed = 0; +- +- m += sizeof(ngx_pool_data_t); +- m = ngx_align_ptr(m, NGX_ALIGNMENT); +- new->d.last = m + size; +- +- for (p = pool->current; p->d.next; p = p->d.next) { +- if (p->d.failed++ > 4) { +- pool->current = p->d.next; +- } +- } +- +- p->d.next = new; +- +- return m; ++ return ngx_malloc(pool, size); + } + + + static void * +-ngx_palloc_large(ngx_pool_t *pool, size_t size) ++ngx_malloc(ngx_pool_t *pool, size_t size) + { +- void *p; +- ngx_uint_t n; +- ngx_pool_large_t *large; ++ void *p; ++ ngx_pool_data_t *d; + + p = ngx_alloc(size, pool->log); + if (p == NULL) { + return NULL; + } + +- n = 0; +- +- for (large = pool->large; large; large = large->next) { +- if (large->alloc == NULL) { +- large->alloc = p; +- return p; +- } +- +- if (n++ > 3) { +- break; +- } +- } +- +- large = ngx_palloc_small(pool, sizeof(ngx_pool_large_t), 1); +- if (large == NULL) { ++ d = ngx_alloc(sizeof(ngx_pool_data_t), pool->log); ++ if (d == NULL){ + ngx_free(p); + return NULL; + } + +- large->alloc = p; +- large->next = pool->large; +- pool->large = large; +- ++ d->alloc = p; ++ d->next = pool->d; ++ pool->d = d; + return p; + } + +@@ -253,38 +156,48 @@ void * + ngx_pmemalign(ngx_pool_t *pool, size_t size, size_t alignment) + { + void *p; +- ngx_pool_large_t *large; ++ ngx_pool_data_t *d; + + p = ngx_memalign(alignment, size, pool->log); + if (p == NULL) { + return NULL; + } + +- large = ngx_palloc_small(pool, sizeof(ngx_pool_large_t), 1); +- if (large == NULL) { ++ d = ngx_alloc(sizeof(ngx_pool_data_t), pool->log); ++ if (d == NULL){ + ngx_free(p); + return NULL; + } + +- large->alloc = p; +- large->next = pool->large; +- pool->large = large; +- ++ d->alloc = p; ++ d->next = pool->d; ++ pool->d = d; + return p; + } + + + ngx_int_t +-ngx_pfree(ngx_pool_t *pool, void *p) ++ngx_pfree(ngx_pool_t *pool, void *data) + { +- ngx_pool_large_t *l; ++ ngx_pool_data_t *p, *d; + +- for (l = pool->large; l; l = l->next) { +- if (p == l->alloc) { +- ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, pool->log, 0, +- "free: %p", l->alloc); +- ngx_free(l->alloc); +- l->alloc = NULL; ++ p = NULL; ++ for (d = pool->d; d; p = d, d = d->next) { ++ if (data == d->alloc) { ++ ++ ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, pool->log, 0, "free: %p", d->alloc); ++ ++ ngx_free(d->alloc); ++ d->alloc = NULL; ++ ++ if (p) { ++ p->next = d->next; ++ ++ } else { ++ pool->d = d->next; ++ } ++ ++ ngx_free(d); + + return NGX_OK; + } +diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.27.1/src/core/ngx_palloc.h nginx-1.27.1-patched/src/core/ngx_palloc.h +--- nginx-1.27.1/src/core/ngx_palloc.h 2016-04-19 09:02:38.000000000 -0700 ++++ nginx-1.27.1-patched/src/core/ngx_palloc.h 2016-04-21 16:25:07.454949755 -0700 +@@ -38,28 +38,21 @@ struct ngx_pool_cleanup_s { + }; + + +-typedef struct ngx_pool_large_s ngx_pool_large_t; +- +-struct ngx_pool_large_s { +- ngx_pool_large_t *next; +- void *alloc; +-}; ++typedef struct ngx_pool_data_s ngx_pool_large_t; ++typedef struct ngx_pool_data_s ngx_pool_data_t; + + +-typedef struct { +- u_char *last; +- u_char *end; +- ngx_pool_t *next; +- ngx_uint_t failed; +-} ngx_pool_data_t; ++struct ngx_pool_data_s { ++ ngx_pool_data_t *next; ++ void *alloc; ++}; + + + struct ngx_pool_s { +- ngx_pool_data_t d; ++ ngx_pool_data_t *d; + size_t max; + ngx_pool_t *current; + ngx_chain_t *chain; +- ngx_pool_large_t *large; + ngx_pool_cleanup_t *cleanup; + ngx_log_t *log; + }; diff --git a/images/nginx/rootfs/patches/23_nginx-1.25.3-pcre_conf_opt.patch b/images/nginx/rootfs/patches/nginx-1.27.1-pcre_conf_opt.patch similarity index 100% rename from images/nginx/rootfs/patches/23_nginx-1.25.3-pcre_conf_opt.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-pcre_conf_opt.patch diff --git a/images/nginx/rootfs/patches/11_nginx-1.25.3-privileged_agent_process.patch b/images/nginx/rootfs/patches/nginx-1.27.1-privileged_agent_process.patch similarity index 100% rename from images/nginx/rootfs/patches/11_nginx-1.25.3-privileged_agent_process.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-privileged_agent_process.patch diff --git a/images/nginx/rootfs/patches/12_nginx-1.25.3-privileged_agent_process_connections.patch b/images/nginx/rootfs/patches/nginx-1.27.1-privileged_agent_process_connections.patch similarity index 100% rename from images/nginx/rootfs/patches/12_nginx-1.25.3-privileged_agent_process_connections.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-privileged_agent_process_connections.patch diff --git a/images/nginx/rootfs/patches/13_nginx-1.25.3-privileged_agent_process_thread_pool.patch b/images/nginx/rootfs/patches/nginx-1.27.1-privileged_agent_process_thread_pool.patch similarity index 100% rename from images/nginx/rootfs/patches/13_nginx-1.25.3-privileged_agent_process_thread_pool.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-privileged_agent_process_thread_pool.patch diff --git a/images/nginx/rootfs/patches/nginx-1.27.1-proc_exit_handler.patch b/images/nginx/rootfs/patches/nginx-1.27.1-proc_exit_handler.patch new file mode 100644 index 0000000000..f050c09d8f --- /dev/null +++ b/images/nginx/rootfs/patches/nginx-1.27.1-proc_exit_handler.patch @@ -0,0 +1,77 @@ +diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c +index c4e3c50..fa1408b 100644 +--- a/src/core/ngx_cycle.c ++++ b/src/core/ngx_cycle.c +@@ -264,6 +264,9 @@ ngx_init_cycle(ngx_cycle_t *old_cycle) + } + + ++#if !(NGX_WIN32) ++ ngx_proc_exit_top_handler = ngx_proc_exit_def_handler; ++#endif + conf.ctx = cycle->conf_ctx; + conf.cycle = cycle; + conf.pool = pool; +diff --git a/src/os/unix/ngx_process.c b/src/os/unix/ngx_process.c +index 12a8c68..874c9bf 100644 +--- a/src/os/unix/ngx_process.c ++++ b/src/os/unix/ngx_process.c +@@ -34,6 +34,7 @@ ngx_int_t ngx_process_slot; + ngx_socket_t ngx_channel; + ngx_int_t ngx_last_process; + ngx_process_t ngx_processes[NGX_MAX_PROCESSES]; ++ngx_proc_exit_pt ngx_proc_exit_top_handler; + + + ngx_signal_t signals[] = { +@@ -83,6 +84,13 @@ ngx_signal_t signals[] = { + }; + + ++void ++ngx_proc_exit_def_handler(ngx_pid_t pid) ++{ ++ /* do nothing */ ++} ++ ++ + ngx_pid_t + ngx_spawn_process(ngx_cycle_t *cycle, ngx_spawn_proc_pt proc, void *data, + char *name, ngx_int_t respawn) +@@ -564,6 +572,7 @@ ngx_process_get_status(void) + } + + ngx_unlock_mutexes(pid); ++ ngx_proc_exit_top_handler(pid); + } + } + +diff --git a/src/os/unix/ngx_process.h b/src/os/unix/ngx_process.h +index 3986639..0b55d98 100644 +--- a/src/os/unix/ngx_process.h ++++ b/src/os/unix/ngx_process.h +@@ -18,6 +18,8 @@ typedef pid_t ngx_pid_t; + #define NGX_INVALID_PID -1 + + typedef void (*ngx_spawn_proc_pt) (ngx_cycle_t *cycle, void *data); ++#define NGX_HAVE_PROC_EXIT 1 ++typedef void (*ngx_proc_exit_pt)(ngx_pid_t pid); + + typedef struct { + ngx_pid_t pid; +@@ -66,6 +68,7 @@ ngx_pid_t ngx_spawn_process(ngx_cycle_t *cycle, + ngx_pid_t ngx_execute(ngx_cycle_t *cycle, ngx_exec_ctx_t *ctx); + ngx_int_t ngx_init_signals(ngx_log_t *log); + void ngx_debug_point(void); ++void ngx_proc_exit_def_handler(ngx_pid_t pid); + + + #if (NGX_HAVE_SCHED_YIELD) +@@ -85,6 +88,7 @@ extern ngx_socket_t ngx_channel; + extern ngx_int_t ngx_process_slot; + extern ngx_int_t ngx_last_process; + extern ngx_process_t ngx_processes[NGX_MAX_PROCESSES]; ++extern ngx_proc_exit_pt ngx_proc_exit_top_handler; + + + #endif /* _NGX_PROCESS_H_INCLUDED_ */ diff --git a/images/nginx/rootfs/patches/20_nginx-1.25.3-proxy_host_port_vars.patch b/images/nginx/rootfs/patches/nginx-1.27.1-proxy_host_port_vars.patch similarity index 87% rename from images/nginx/rootfs/patches/20_nginx-1.25.3-proxy_host_port_vars.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-proxy_host_port_vars.patch index 82a3443242..b81a299c8f 100644 --- a/images/nginx/rootfs/patches/20_nginx-1.25.3-proxy_host_port_vars.patch +++ b/images/nginx/rootfs/patches/nginx-1.27.1-proxy_host_port_vars.patch @@ -1,5 +1,5 @@ ---- nginx-1.25.3/src/http/modules/ngx_http_proxy_module.c 2017-07-16 14:02:51.000000000 +0800 -+++ nginx-1.25.3-patched/src/http/modules/ngx_http_proxy_module.c 2017-07-16 14:02:51.000000000 +0800 +--- nginx-1.27.1/src/http/modules/ngx_http_proxy_module.c 2017-07-16 14:02:51.000000000 +0800 ++++ nginx-1.27.1-patched/src/http/modules/ngx_http_proxy_module.c 2017-07-16 14:02:51.000000000 +0800 @@ -793,13 +793,13 @@ static ngx_keyval_t ngx_http_proxy_cach static ngx_http_variable_t ngx_http_proxy_vars[] = { diff --git a/images/nginx/rootfs/patches/06_nginx-1.25.3-resolver_conf_parsing.patch b/images/nginx/rootfs/patches/nginx-1.27.1-resolver_conf_parsing.patch similarity index 100% rename from images/nginx/rootfs/patches/06_nginx-1.25.3-resolver_conf_parsing.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-resolver_conf_parsing.patch diff --git a/images/nginx/rootfs/patches/31_nginx-1.25.3-reuseport_close_unused_fds.patch b/images/nginx/rootfs/patches/nginx-1.27.1-reuseport_close_unused_fds.patch similarity index 100% rename from images/nginx/rootfs/patches/31_nginx-1.25.3-reuseport_close_unused_fds.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-reuseport_close_unused_fds.patch diff --git a/images/nginx/rootfs/patches/29_nginx-1.25.3-safe_resolver_ipv6_option.patch b/images/nginx/rootfs/patches/nginx-1.27.1-safe_resolver_ipv6_option.patch similarity index 100% rename from images/nginx/rootfs/patches/29_nginx-1.25.3-safe_resolver_ipv6_option.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-safe_resolver_ipv6_option.patch diff --git a/images/nginx/rootfs/patches/nginx-1.27.1-server_header.patch b/images/nginx/rootfs/patches/nginx-1.27.1-server_header.patch new file mode 100644 index 0000000000..2e71c37d09 --- /dev/null +++ b/images/nginx/rootfs/patches/nginx-1.27.1-server_header.patch @@ -0,0 +1,39 @@ +diff --git a/src/core/nginx.h b/src/core/nginx.h +index a3c0ef8..1263881 100644 +--- a/src/core/nginx.h ++++ b/src/core/nginx.h +@@ -11,7 +11,7 @@ + + #define nginx_version 1027001 + #define NGINX_VERSION "1.27.1" +-#define NGINX_VER "nginx/" NGINX_VERSION ++#define NGINX_VER "openresty/" NGINX_VERSION ".unknown" + + #ifdef NGX_BUILD + #define NGINX_VER_BUILD NGINX_VER " (" NGX_BUILD ")" +diff --git a/src/http/ngx_http_header_filter_module.c b/src/http/ngx_http_header_filter_module.c +index 9b89405..ca13f2a 100644 +--- a/src/http/ngx_http_header_filter_module.c ++++ b/src/http/ngx_http_header_filter_module.c +@@ -46,7 +46,7 @@ ngx_module_t ngx_http_header_filter_module = { + }; + + +-static u_char ngx_http_server_string[] = "Server: nginx" CRLF; ++static u_char ngx_http_server_string[] = "Server: openresty" CRLF; + static u_char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF; + static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF; + +diff --git a/src/http/v2/ngx_http_v2_filter_module.c b/src/http/v2/ngx_http_v2_filter_module.c +index 8621e7a..a76c677 100644 +--- a/src/http/v2/ngx_http_v2_filter_module.c ++++ b/src/http/v2/ngx_http_v2_filter_module.c +@@ -143,7 +143,7 @@ ngx_http_v2_header_filter(ngx_http_request_t *r) + ngx_http_core_srv_conf_t *cscf; + u_char addr[NGX_SOCKADDR_STRLEN]; + +- static const u_char nginx[5] = "\x84\xaa\x63\x55\xe7"; ++ static const u_char nginx[8] = "\x87\x3d\x65\xaa\xc2\xa1\x3e\xbf"; + #if (NGX_HTTP_GZIP) + static const u_char accept_encoding[12] = + "\x8b\x84\x84\x2d\x69\x5b\x05\x44\x3c\x86\xaa\x6f"; diff --git a/images/nginx/rootfs/patches/nginx-1.27.1-setting_args_invalidates_uri.patch b/images/nginx/rootfs/patches/nginx-1.27.1-setting_args_invalidates_uri.patch new file mode 100644 index 0000000000..c2fcd4cf2e --- /dev/null +++ b/images/nginx/rootfs/patches/nginx-1.27.1-setting_args_invalidates_uri.patch @@ -0,0 +1,44 @@ +# HG changeset patch +# User Yichun Zhang +# Date 1390506359 28800 +# Node ID 17186b98c235c07e94c64e5853689f790f173756 +# Parent 4b50d1f299d8a69f3e3f7975132e1490352642fe +Variable: setting $args should invalidate unparsed uri. + +diff -r 4b50d1f299d8 -r 17186b98c235 src/http/ngx_http_variables.c +--- a/src/http/ngx_http_variables.c Fri Jan 10 11:22:14 2014 -0800 ++++ b/src/http/ngx_http_variables.c Thu Jan 23 11:45:59 2014 -0800 +@@ -15,6 +15,8 @@ + ngx_http_variable_value_t *v, uintptr_t data); + static void ngx_http_variable_request_set(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data); ++static void ngx_http_variable_request_args_set(ngx_http_request_t *r, ++ ngx_http_variable_value_t *v, uintptr_t data); + static ngx_int_t ngx_http_variable_request_get_size(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data); + static void ngx_http_variable_request_set_size(ngx_http_request_t *r, +@@ -218,7 +220,7 @@ + NGX_HTTP_VAR_NOCACHEABLE, 0 }, + + { ngx_string("args"), +- ngx_http_variable_request_set, ++ ngx_http_variable_request_args_set, + ngx_http_variable_request, + offsetof(ngx_http_request_t, args), + NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 }, +@@ -647,6 +649,15 @@ + + + static void ++ngx_http_variable_request_args_set(ngx_http_request_t *r, ++ ngx_http_variable_value_t *v, uintptr_t data) ++{ ++ r->valid_unparsed_uri = 0; ++ ngx_http_variable_request_set(r, v, data); ++} ++ ++ ++static void + ngx_http_variable_request_set(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data) + { diff --git a/images/nginx/rootfs/patches/14_nginx-1.25.3-single_process_graceful_exit.patch b/images/nginx/rootfs/patches/nginx-1.27.1-single_process_graceful_exit.patch similarity index 100% rename from images/nginx/rootfs/patches/14_nginx-1.25.3-single_process_graceful_exit.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-single_process_graceful_exit.patch diff --git a/images/nginx/rootfs/patches/30_nginx-1.25.3-socket_cloexec.patch b/images/nginx/rootfs/patches/nginx-1.27.1-socket_cloexec.patch similarity index 100% rename from images/nginx/rootfs/patches/30_nginx-1.25.3-socket_cloexec.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-socket_cloexec.patch diff --git a/images/nginx/rootfs/patches/25_nginx-1.25.3-ssl_cert_cb_yield.patch b/images/nginx/rootfs/patches/nginx-1.27.1-ssl_cert_cb_yield.patch similarity index 100% rename from images/nginx/rootfs/patches/25_nginx-1.25.3-ssl_cert_cb_yield.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-ssl_cert_cb_yield.patch diff --git a/images/nginx/rootfs/patches/27_nginx-1.25.3-ssl_client_hello_cb_yield.patch b/images/nginx/rootfs/patches/nginx-1.27.1-ssl_client_hello_cb_yield.patch similarity index 100% rename from images/nginx/rootfs/patches/27_nginx-1.25.3-ssl_client_hello_cb_yield.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-ssl_client_hello_cb_yield.patch diff --git a/images/nginx/rootfs/patches/26_nginx-1.25.3-ssl_sess_cb_yield.patch b/images/nginx/rootfs/patches/nginx-1.27.1-ssl_sess_cb_yield.patch similarity index 100% rename from images/nginx/rootfs/patches/26_nginx-1.25.3-ssl_sess_cb_yield.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-ssl_sess_cb_yield.patch diff --git a/images/nginx/rootfs/patches/02_nginx-1.25.3-stream_balancer_export.patch b/images/nginx/rootfs/patches/nginx-1.27.1-stream_balancer_export.patch similarity index 100% rename from images/nginx/rootfs/patches/02_nginx-1.25.3-stream_balancer_export.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-stream_balancer_export.patch diff --git a/images/nginx/rootfs/patches/03_nginx-1.25.3-stream_proxy_get_next_upstream_tries.patch b/images/nginx/rootfs/patches/nginx-1.27.1-stream_proxy_get_next_upstream_tries.patch similarity index 100% rename from images/nginx/rootfs/patches/03_nginx-1.25.3-stream_proxy_get_next_upstream_tries.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-stream_proxy_get_next_upstream_tries.patch diff --git a/images/nginx/rootfs/patches/04_nginx-1.25.3-stream_proxy_timeout_fields.patch b/images/nginx/rootfs/patches/nginx-1.27.1-stream_proxy_timeout_fields.patch similarity index 92% rename from images/nginx/rootfs/patches/04_nginx-1.25.3-stream_proxy_timeout_fields.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-stream_proxy_timeout_fields.patch index 39c59e206d..e205abb8ba 100644 --- a/images/nginx/rootfs/patches/04_nginx-1.25.3-stream_proxy_timeout_fields.patch +++ b/images/nginx/rootfs/patches/nginx-1.27.1-stream_proxy_timeout_fields.patch @@ -1,6 +1,6 @@ -diff -u -r -p -Naur nginx-1.25.3/src/stream/ngx_stream.h nginx-1.25.3-patched/src/stream/ngx_stream.h ---- nginx-1.25.3/src/stream/ngx_stream.h 2021-11-04 21:27:55.288708527 +0800 -+++ nginx-1.25.3-patched/src/stream/ngx_stream.h 2021-11-04 21:28:50.768035209 +0800 +diff -u -r -p -Naur nginx-1.27.1/src/stream/ngx_stream.h nginx-1.27.1-patched/src/stream/ngx_stream.h +--- nginx-1.27.1/src/stream/ngx_stream.h 2021-11-04 21:27:55.288708527 +0800 ++++ nginx-1.27.1-patched/src/stream/ngx_stream.h 2021-11-04 21:28:50.768035209 +0800 @@ -254,6 +254,15 @@ typedef struct { } ngx_stream_module_t; @@ -25,9 +25,9 @@ diff -u -r -p -Naur nginx-1.25.3/src/stream/ngx_stream.h nginx-1.25.3-patched/sr typedef ngx_int_t (*ngx_stream_filter_pt)(ngx_stream_session_t *s, -diff -u -r -p -Naur nginx-1.25.3/src/stream/ngx_stream_proxy_module.c nginx-1.25.3-patched/src/stream/ngx_stream_proxy_module.c ---- nginx-1.25.3/src/stream/ngx_stream_proxy_module.c 2021-11-04 21:27:55.289708533 +0800 -+++ nginx-1.25.3-patched/src/stream/ngx_stream_proxy_module.c 2021-11-04 21:37:03.578936990 +0800 +diff -u -r -p -Naur nginx-1.27.1/src/stream/ngx_stream_proxy_module.c nginx-1.27.1-patched/src/stream/ngx_stream_proxy_module.c +--- nginx-1.27.1/src/stream/ngx_stream_proxy_module.c 2021-11-04 21:27:55.289708533 +0800 ++++ nginx-1.27.1-patched/src/stream/ngx_stream_proxy_module.c 2021-11-04 21:37:03.578936990 +0800 @@ -400,6 +400,7 @@ ngx_stream_proxy_handler(ngx_stream_sess ngx_stream_proxy_srv_conf_t *pscf; ngx_stream_upstream_srv_conf_t *uscf, **uscfp; diff --git a/images/nginx/rootfs/patches/05_nginx-1.25.3-stream_ssl_preread_no_skip.patch b/images/nginx/rootfs/patches/nginx-1.27.1-stream_ssl_preread_no_skip.patch similarity index 100% rename from images/nginx/rootfs/patches/05_nginx-1.25.3-stream_ssl_preread_no_skip.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-stream_ssl_preread_no_skip.patch diff --git a/images/nginx/rootfs/patches/16_nginx-1.25.3-upstream_pipelining.patch b/images/nginx/rootfs/patches/nginx-1.27.1-upstream_pipelining.patch similarity index 100% rename from images/nginx/rootfs/patches/16_nginx-1.25.3-upstream_pipelining.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-upstream_pipelining.patch diff --git a/images/nginx/rootfs/patches/28_nginx-1.25.3-upstream_timeout_fields.patch b/images/nginx/rootfs/patches/nginx-1.27.1-upstream_timeout_fields.patch similarity index 100% rename from images/nginx/rootfs/patches/28_nginx-1.25.3-upstream_timeout_fields.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-upstream_timeout_fields.patch diff --git a/images/nginx/rootfs/patches/01_nginx-1.25.3-win32_max_err_str.patch b/images/nginx/rootfs/patches/nginx-1.27.1-win32_max_err_str.patch similarity index 100% rename from images/nginx/rootfs/patches/01_nginx-1.25.3-win32_max_err_str.patch rename to images/nginx/rootfs/patches/nginx-1.27.1-win32_max_err_str.patch