Skip to content

Commit

Permalink
update nginx to v1.19.7
Browse files Browse the repository at this point in the history
  • Loading branch information
pangpang@hi-nginx.com committed Feb 21, 2021
1 parent ad056b0 commit 25e5a61
Show file tree
Hide file tree
Showing 17 changed files with 271 additions and 188 deletions.
27 changes: 27 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@

Changes with nginx 1.19.7 16 Feb 2021

*) Change: connections handling in HTTP/2 has been changed to better
match HTTP/1.x; the "http2_recv_timeout", "http2_idle_timeout", and
"http2_max_requests" directives have been removed, the
"keepalive_timeout" and "keepalive_requests" directives should be
used instead.

*) Change: the "http2_max_field_size" and "http2_max_header_size"
directives have been removed, the "large_client_header_buffers"
directive should be used instead.

*) Feature: now, if free worker connections are exhausted, nginx starts
closing not only keepalive connections, but also connections in
lingering close.

*) Bugfix: "zero size buf in output" alerts might appear in logs if an
upstream server returned an incorrect response during unbuffered
proxying; the bug had appeared in 1.19.1.

*) Bugfix: HEAD requests were handled incorrectly if the "return"
directive was used with the "image_filter" or "xslt_stylesheet"
directives.

*) Bugfix: in the "add_trailer" directive.


Changes with nginx 1.19.6 15 Dec 2020

*) Bugfix: "no live upstreams" errors if a "server" inside "upstream"
Expand Down
26 changes: 26 additions & 0 deletions CHANGES.ru
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@

Изменения в nginx 1.19.7 16.02.2021

*) Изменение: обработка соединений в HTTP/2 была изменена и теперь более
соответствует HTTP/1.x; директивы http2_recv_timeout,
http2_idle_timeout и http2_max_requests упразднены, вместо них
следует использовать директивы keepalive_timeout и
keepalive_requests.

*) Изменение: директивы http2_max_field_size и http2_max_header_size
упразднены, вместо них следует использовать директиву
large_client_header_buffers.

*) Добавление: теперь при исчерпании свободных соединений nginx
закрывает не только keepalive-соединения, но и соединения в lingering
close.

*) Исправление: в логах могли появляться сообщения "zero size buf in
output", если бэкенд возвращал некорректный ответ при
небуферизированном проксировании; ошибка появилась в 1.19.1.

*) Исправление: при использовании директивы return вместе с image_filter
или xslt_stylesheet HEAD-запросы обрабатывались некорректно.

*) Исправление: в директиве add_trailer.


Изменения в nginx 1.19.6 15.12.2020

*) Исправление: ошибки "no live upstreams", если server в блоке upstream
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2002-2019 Igor Sysoev
* Copyright (C) 2011-2019 Nginx, Inc.
* Copyright (C) 2002-2021 Igor Sysoev
* Copyright (C) 2011-2021 Nginx, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
43 changes: 37 additions & 6 deletions contrib/vim/syntax/nginx.vim
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ syn keyword ngxDirective contained grpc_socket_keepalive
syn keyword ngxDirective contained grpc_ssl_certificate
syn keyword ngxDirective contained grpc_ssl_certificate_key
syn keyword ngxDirective contained grpc_ssl_ciphers
syn keyword ngxDirective contained grpc_ssl_conf_command
syn keyword ngxDirective contained grpc_ssl_crl
syn keyword ngxDirective contained grpc_ssl_name
syn keyword ngxDirective contained grpc_ssl_password_file
Expand Down Expand Up @@ -447,6 +448,7 @@ syn keyword ngxDirective contained proxy_cache_use_stale
syn keyword ngxDirective contained proxy_cache_valid
syn keyword ngxDirective contained proxy_connect_timeout
syn keyword ngxDirective contained proxy_cookie_domain
syn keyword ngxDirective contained proxy_cookie_flags
syn keyword ngxDirective contained proxy_cookie_path
syn keyword ngxDirective contained proxy_download_rate
syn keyword ngxDirective contained proxy_force_ranges
Expand Down Expand Up @@ -480,11 +482,13 @@ syn keyword ngxDirective contained proxy_send_timeout
syn keyword ngxDirective contained proxy_session_drop
syn keyword ngxDirective contained proxy_set_body
syn keyword ngxDirective contained proxy_set_header
syn keyword ngxDirective contained proxy_smtp_auth
syn keyword ngxDirective contained proxy_socket_keepalive
syn keyword ngxDirective contained proxy_ssl
syn keyword ngxDirective contained proxy_ssl_certificate
syn keyword ngxDirective contained proxy_ssl_certificate_key
syn keyword ngxDirective contained proxy_ssl_ciphers
syn keyword ngxDirective contained proxy_ssl_conf_command
syn keyword ngxDirective contained proxy_ssl_crl
syn keyword ngxDirective contained proxy_ssl_name
syn keyword ngxDirective contained proxy_ssl_password_file
Expand Down Expand Up @@ -592,6 +596,7 @@ syn keyword ngxDirective contained ssl_certificate
syn keyword ngxDirective contained ssl_certificate_key
syn keyword ngxDirective contained ssl_ciphers
syn keyword ngxDirective contained ssl_client_certificate
syn keyword ngxDirective contained ssl_conf_command
syn keyword ngxDirective contained ssl_crl
syn keyword ngxDirective contained ssl_dhparam
syn keyword ngxDirective contained ssl_early_data
Expand All @@ -605,6 +610,7 @@ syn keyword ngxDirective contained ssl_password_file
syn keyword ngxDirective contained ssl_prefer_server_ciphers
syn keyword ngxDirective contained ssl_preread
syn keyword ngxDirective contained ssl_protocols
syn keyword ngxDirective contained ssl_reject_handshake
syn keyword ngxDirective contained ssl_session_cache
syn keyword ngxDirective contained ssl_session_ticket_key
syn keyword ngxDirective contained ssl_session_tickets
Expand Down Expand Up @@ -643,6 +649,7 @@ syn keyword ngxDirective contained user
syn keyword ngxDirective contained userid
syn keyword ngxDirective contained userid_domain
syn keyword ngxDirective contained userid_expires
syn keyword ngxDirective contained userid_flags
syn keyword ngxDirective contained userid_mark
syn keyword ngxDirective contained userid_name
syn keyword ngxDirective contained userid_p3p
Expand Down Expand Up @@ -693,6 +700,7 @@ syn keyword ngxDirective contained uwsgi_socket_keepalive
syn keyword ngxDirective contained uwsgi_ssl_certificate
syn keyword ngxDirective contained uwsgi_ssl_certificate_key
syn keyword ngxDirective contained uwsgi_ssl_ciphers
syn keyword ngxDirective contained uwsgi_ssl_conf_command
syn keyword ngxDirective contained uwsgi_ssl_crl
syn keyword ngxDirective contained uwsgi_ssl_name
syn keyword ngxDirective contained uwsgi_ssl_password_file
Expand Down Expand Up @@ -738,6 +746,7 @@ syn keyword ngxDirective contained zone_sync_ssl
syn keyword ngxDirective contained zone_sync_ssl_certificate
syn keyword ngxDirective contained zone_sync_ssl_certificate_key
syn keyword ngxDirective contained zone_sync_ssl_ciphers
syn keyword ngxDirective contained zone_sync_ssl_conf_command
syn keyword ngxDirective contained zone_sync_ssl_crl
syn keyword ngxDirective contained zone_sync_ssl_name
syn keyword ngxDirective contained zone_sync_ssl_password_file
Expand Down Expand Up @@ -1329,6 +1338,8 @@ syn keyword ngxDirectiveThirdParty contained body_filter_by_lua_file
syn keyword ngxDirectiveThirdParty contained content_by_lua
syn keyword ngxDirectiveThirdParty contained content_by_lua_block
syn keyword ngxDirectiveThirdParty contained content_by_lua_file
syn keyword ngxDirectiveThirdParty contained exit_worker_by_lua_block
syn keyword ngxDirectiveThirdParty contained exit_worker_by_lua_file
syn keyword ngxDirectiveThirdParty contained header_filter_by_lua
syn keyword ngxDirectiveThirdParty contained header_filter_by_lua_block
syn keyword ngxDirectiveThirdParty contained header_filter_by_lua_file
Expand Down Expand Up @@ -1370,6 +1381,7 @@ syn keyword ngxDirectiveThirdParty contained lua_ssl_crl
syn keyword ngxDirectiveThirdParty contained lua_ssl_protocols
syn keyword ngxDirectiveThirdParty contained lua_ssl_trusted_certificate
syn keyword ngxDirectiveThirdParty contained lua_ssl_verify_depth
syn keyword ngxDirectiveThirdParty contained lua_thread_cache_max_entries
syn keyword ngxDirectiveThirdParty contained lua_transform_underscores_in_response_headers
syn keyword ngxDirectiveThirdParty contained lua_use_default_type
syn keyword ngxDirectiveThirdParty contained rewrite_by_lua
Expand Down Expand Up @@ -2285,6 +2297,7 @@ syn keyword ngxDirectiveThirdParty contained testcookie_refresh_encrypt_cookie_i
syn keyword ngxDirectiveThirdParty contained testcookie_refresh_encrypt_cookie_key
syn keyword ngxDirectiveThirdParty contained testcookie_refresh_status
syn keyword ngxDirectiveThirdParty contained testcookie_refresh_template
syn keyword ngxDirectiveThirdParty contained testcookie_samesite
syn keyword ngxDirectiveThirdParty contained testcookie_secret
syn keyword ngxDirectiveThirdParty contained testcookie_secure_flag
syn keyword ngxDirectiveThirdParty contained testcookie_session
Expand Down Expand Up @@ -2355,28 +2368,46 @@ syn keyword ngxDirectiveThirdParty contained websockify_send_timeout

" IP2Location Nginx
" https://github.com/ip2location/ip2location-nginx
syn keyword ngxDirectiveThirdParty contained ip2location
syn keyword ngxDirectiveThirdParty contained ip2location_access_type
syn keyword ngxDirectiveThirdParty contained ip2location_proxy
syn keyword ngxDirectiveThirdParty contained ip2location_proxy_recursive
syn keyword ngxDirectiveThirdParty contained ip2location_areacode
syn keyword ngxDirectiveThirdParty contained ip2location_city
syn keyword ngxDirectiveThirdParty contained ip2location_country_long
syn keyword ngxDirectiveThirdParty contained ip2location_country_short
syn keyword ngxDirectiveThirdParty contained ip2location_domain
syn keyword ngxDirectiveThirdParty contained ip2location_elevation
syn keyword ngxDirectiveThirdParty contained ip2location_iddcode
syn keyword ngxDirectiveThirdParty contained ip2location_isp
syn keyword ngxDirectiveThirdParty contained ip2location_latitude
syn keyword ngxDirectiveThirdParty contained ip2location_longitude
syn keyword ngxDirectiveThirdParty contained ip2location_mcc
syn keyword ngxDirectiveThirdParty contained ip2location_mnc
syn keyword ngxDirectiveThirdParty contained ip2location_mobilebrand
syn keyword ngxDirectiveThirdParty contained ip2location_netspeed
syn keyword ngxDirectiveThirdParty contained ip2location_region
syn keyword ngxDirectiveThirdParty contained ip2location_timezone
syn keyword ngxDirectiveThirdParty contained ip2location_usagetype
syn keyword ngxDirectiveThirdParty contained ip2location_weatherstationcode
syn keyword ngxDirectiveThirdParty contained ip2location_weatherstationname
syn keyword ngxDirectiveThirdParty contained ip2location_zipcode

" IP2Proxy module for Nginx
" https://github.com/ip2location/ip2proxy-nginx
syn keyword ngxDirectiveThirdParty contained ip2proxy
syn keyword ngxDirectiveThirdParty contained ip2proxy_access_type
syn keyword ngxDirectiveThirdParty contained ip2proxy_as
syn keyword ngxDirectiveThirdParty contained ip2proxy_asn
syn keyword ngxDirectiveThirdParty contained ip2proxy_city
syn keyword ngxDirectiveThirdParty contained ip2proxy_country_long
syn keyword ngxDirectiveThirdParty contained ip2proxy_country_short
syn keyword ngxDirectiveThirdParty contained ip2proxy_database
syn keyword ngxDirectiveThirdParty contained ip2proxy_domain
syn keyword ngxDirectiveThirdParty contained ip2proxy_is_proxy
syn keyword ngxDirectiveThirdParty contained ip2proxy_isp
syn keyword ngxDirectiveThirdParty contained ip2proxy_is_proxy
syn keyword ngxDirectiveThirdParty contained ip2proxy_last_seen
syn keyword ngxDirectiveThirdParty contained ip2proxy_proxy
syn keyword ngxDirectiveThirdParty contained ip2proxy_proxy_recursive
syn keyword ngxDirectiveThirdParty contained ip2proxy_proxy_type
syn keyword ngxDirectiveThirdParty contained ip2proxy_region
syn keyword ngxDirectiveThirdParty contained ip2proxy_reverse_proxy
syn keyword ngxDirectiveThirdParty contained ip2proxy_threat
syn keyword ngxDirectiveThirdParty contained ip2proxy_usage_type


Expand Down
4 changes: 2 additions & 2 deletions src/core/nginx.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define _NGINX_H_INCLUDED_


#define nginx_version 1019006
#define NGINX_VERSION "1.19.6"
#define nginx_version 1019007
#define NGINX_VERSION "1.19.7"
#define NGINX_VER "nginx/" NGINX_VERSION

#ifdef NGX_BUILD
Expand Down
16 changes: 16 additions & 0 deletions src/core/ngx_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,7 @@ ngx_drain_connections(ngx_cycle_t *cycle)
cycle->connection_n);
}

c = NULL;
n = ngx_max(ngx_min(32, cycle->reusable_connections_n / 8), 1);

for (i = 0; i < n; i++) {
Expand All @@ -1326,6 +1327,21 @@ ngx_drain_connections(ngx_cycle_t *cycle)
c->close = 1;
c->read->handler(c->read);
}

if (cycle->free_connection_n == 0 && c && c->reusable) {

/*
* if no connections were freed, try to reuse the last
* connection again: this should free it as long as
* previous reuse moved it to lingering close
*/

ngx_log_debug0(NGX_LOG_DEBUG_CORE, c->log, 0,
"reusing connection again");

c->close = 1;
c->read->handler(c->read);
}
}


Expand Down
2 changes: 0 additions & 2 deletions src/core/ngx_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ struct ngx_listening_s {
size_t pool_size;
/* should be here because of the AcceptEx() preread */
size_t post_accept_buffer_size;
/* should be here because of the deferred accept */
ngx_msec_t post_accept_timeout;

ngx_listening_t *previous;
ngx_connection_t *connection;
Expand Down
7 changes: 7 additions & 0 deletions src/http/modules/ngx_http_proxy_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -2334,6 +2334,13 @@ ngx_http_proxy_non_buffered_copy_filter(void *data, ssize_t bytes)

u = r->upstream;

if (u->length == 0) {
ngx_log_error(NGX_LOG_WARN, r->connection->log, 0,
"upstream sent more data than specified in "
"\"Content-Length\" header");
return NGX_OK;
}

for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) {
ll = &cl->next;
}
Expand Down
10 changes: 0 additions & 10 deletions src/http/modules/ngx_http_stub_status_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,6 @@ ngx_http_stub_status_handler(ngx_http_request_t *r)
ngx_str_set(&r->headers_out.content_type, "text/plain");
r->headers_out.content_type_lowcase = NULL;

if (r->method == NGX_HTTP_HEAD) {
r->headers_out.status = NGX_HTTP_OK;

rc = ngx_http_send_header(r);

if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
return rc;
}
}

size = sizeof("Active connections: \n") + NGX_ATOMIC_T_LEN
+ sizeof("server accepts handled requests\n") - 1
+ 6 + 3 * NGX_ATOMIC_T_LEN
Expand Down
1 change: 0 additions & 1 deletion src/http/ngx_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,6 @@ ngx_http_add_listening(ngx_conf_t *cf, ngx_http_conf_addr_t *addr)

cscf = addr->default_server;
ls->pool_size = cscf->connection_pool_size;
ls->post_accept_timeout = cscf->client_header_timeout;

clcf = cscf->ctx->loc_conf[ngx_http_core_module.ctx_index];

Expand Down
10 changes: 1 addition & 9 deletions src/http/ngx_http_core_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@ ngx_http_send_response(ngx_http_request_t *r, ngx_uint_t status,
}
}

if (r->method == NGX_HTTP_HEAD || (r != r->main && val.len == 0)) {
if (r != r->main && val.len == 0) {
return ngx_http_send_header(r);
}

Expand Down Expand Up @@ -4078,14 +4078,6 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
#endif
}

if (ngx_strcmp(value[n].data, "spdy") == 0) {
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
"invalid parameter \"spdy\": "
"ngx_http_spdy_module was superseded "
"by ngx_http_v2_module");
continue;
}

if (ngx_strncmp(value[n].data, "so_keepalive=", 13) == 0) {

if (ngx_strcmp(&value[n].data[13], "on") == 0) {
Expand Down
Loading

0 comments on commit 25e5a61

Please sign in to comment.