Skip to content

Commit 8bbcd19

Browse files
author
pangpang@hi-nginx.com
committed
update nginx to v1.25.1
1 parent 5d0ec84 commit 8bbcd19

18 files changed

+216
-1222
lines changed

CHANGES

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11

2+
Changes with nginx 1.25.1 13 Jun 2023
3+
4+
*) Feature: the "http2" directive, which enables HTTP/2 on a per-server
5+
basis; the "http2" parameter of the "listen" directive is now
6+
deprecated.
7+
8+
*) Change: HTTP/2 server push support has been removed.
9+
10+
*) Change: the deprecated "ssl" directive is not supported anymore.
11+
12+
*) Bugfix: in HTTP/3 when using OpenSSL.
13+
14+
215
Changes with nginx 1.25.0 23 May 2023
316

417
*) Feature: experimental HTTP/3 support.

CHANGES.ru

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11

2+
Изменения в nginx 1.25.1 13.06.2023
3+
4+
*) Добавление: директива http2, позволяющая включать HTTP/2 в отдельных
5+
блоках server; параметр http2 директивы listen объявлен устаревшим.
6+
7+
*) Изменение: поддержка HTTP/2 server push упразднена.
8+
9+
*) Изменение: устаревшая директива ssl больше не поддерживается.
10+
11+
*) Исправление: в HTTP/3 при использовании OpenSSL.
12+
13+
214
Изменения в nginx 1.25.0 23.05.2023
315

416
*) Добавление: экспериментальная поддержка HTTP/3.

auto/modules

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ if [ $HTTP = YES ]; then
423423

424424
if [ $HTTP_V2 = YES ]; then
425425
have=NGX_HTTP_V2 . auto/have
426-
have=NGX_HTTP_HEADERS . auto/have
427426

428427
ngx_module_name=ngx_http_v2_module
429428
ngx_module_incs=src/http/v2
@@ -444,7 +443,6 @@ if [ $HTTP = YES ]; then
444443
HTTP_SSL=YES
445444

446445
have=NGX_HTTP_V3 . auto/have
447-
have=NGX_HTTP_HEADERS . auto/have
448446

449447
ngx_module_name=ngx_http_v3_module
450448
ngx_module_incs=src/http/v3

src/core/nginx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#define _NGINX_H_INCLUDED_
1010

1111

12-
#define nginx_version 1025000
13-
#define NGINX_VERSION "1.25.0"
12+
#define nginx_version 1025001
13+
#define NGINX_VERSION "1.25.1"
1414
#define NGINX_VER "nginx/" NGINX_VERSION
1515

1616
#ifdef NGX_BUILD

src/event/quic/ngx_event_quic_ack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ ngx_quic_rtt_sample(ngx_connection_t *c, ngx_quic_ack_frame_t *ack,
207207
adjusted_rtt -= ack_delay;
208208
}
209209

210-
qc->avg_rtt += (adjusted_rtt >> 3) - (qc->avg_rtt >> 3);
211210
rttvar_sample = ngx_abs((ngx_msec_int_t) (qc->avg_rtt - adjusted_rtt));
212211
qc->rttvar += (rttvar_sample >> 2) - (qc->rttvar >> 2);
212+
qc->avg_rtt += (adjusted_rtt >> 3) - (qc->avg_rtt >> 3);
213213
}
214214

215215
ngx_log_debug4(NGX_LOG_DEBUG_EVENT, c->log, 0,

src/event/quic/ngx_event_quic_openssl_compat.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ SSL_provide_quic_data(SSL *ssl, enum ssl_encryption_level_t level,
463463
rec.log = c->log;
464464
rec.number = com->read_record++;
465465
rec.keys = &com->keys;
466+
rec.level = level;
466467

467468
if (level == ssl_encryption_initial) {
468469
n = ngx_min(len, 65535);

src/http/modules/ngx_http_ssl_module.c

Lines changed: 17 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ static char *ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf,
4343
static ngx_int_t ngx_http_ssl_compile_certificates(ngx_conf_t *cf,
4444
ngx_http_ssl_srv_conf_t *conf);
4545

46-
static char *ngx_http_ssl_enable(ngx_conf_t *cf, ngx_command_t *cmd,
47-
void *conf);
4846
static char *ngx_http_ssl_password_file(ngx_conf_t *cf, ngx_command_t *cmd,
4947
void *conf);
5048
static char *ngx_http_ssl_session_cache(ngx_conf_t *cf, ngx_command_t *cmd,
@@ -90,24 +88,12 @@ static ngx_conf_enum_t ngx_http_ssl_ocsp[] = {
9088
};
9189

9290

93-
static ngx_conf_deprecated_t ngx_http_ssl_deprecated = {
94-
ngx_conf_deprecated, "ssl", "listen ... ssl"
95-
};
96-
97-
9891
static ngx_conf_post_t ngx_http_ssl_conf_command_post =
9992
{ ngx_http_ssl_conf_command_check };
10093

10194

10295
static ngx_command_t ngx_http_ssl_commands[] = {
10396

104-
{ ngx_string("ssl"),
105-
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
106-
ngx_http_ssl_enable,
107-
NGX_HTTP_SRV_CONF_OFFSET,
108-
offsetof(ngx_http_ssl_srv_conf_t, enable),
109-
&ngx_http_ssl_deprecated },
110-
11197
{ ngx_string("ssl_certificate"),
11298
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
11399
ngx_conf_set_str_array_slot,
@@ -435,6 +421,9 @@ ngx_http_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn, const unsigned char **out,
435421
#if (NGX_HTTP_V2 || NGX_HTTP_V3)
436422
ngx_http_connection_t *hc;
437423
#endif
424+
#if (NGX_HTTP_V2)
425+
ngx_http_v2_srv_conf_t *h2scf;
426+
#endif
438427
#if (NGX_HTTP_V3)
439428
ngx_http_v3_srv_conf_t *h3scf;
440429
#endif
@@ -456,12 +445,6 @@ ngx_http_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn, const unsigned char **out,
456445
hc = c->data;
457446
#endif
458447

459-
#if (NGX_HTTP_V2)
460-
if (hc->addr_conf->http2) {
461-
srv = (unsigned char *) NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS;
462-
srvlen = sizeof(NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS) - 1;
463-
} else
464-
#endif
465448
#if (NGX_HTTP_V3)
466449
if (hc->addr_conf->quic) {
467450

@@ -488,8 +471,19 @@ ngx_http_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn, const unsigned char **out,
488471
} else
489472
#endif
490473
{
491-
srv = (unsigned char *) NGX_HTTP_ALPN_PROTOS;
492-
srvlen = sizeof(NGX_HTTP_ALPN_PROTOS) - 1;
474+
#if (NGX_HTTP_V2)
475+
h2scf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_v2_module);
476+
477+
if (h2scf->enable || hc->addr_conf->http2) {
478+
srv = (unsigned char *) NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS;
479+
srvlen = sizeof(NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS) - 1;
480+
481+
} else
482+
#endif
483+
{
484+
srv = (unsigned char *) NGX_HTTP_ALPN_PROTOS;
485+
srvlen = sizeof(NGX_HTTP_ALPN_PROTOS) - 1;
486+
}
493487
}
494488

495489
if (SSL_select_next_proto((unsigned char **) out, outlen, srv, srvlen,
@@ -617,7 +611,6 @@ ngx_http_ssl_create_srv_conf(ngx_conf_t *cf)
617611
* sscf->stapling_responder = { 0, NULL };
618612
*/
619613

620-
sscf->enable = NGX_CONF_UNSET;
621614
sscf->prefer_server_ciphers = NGX_CONF_UNSET;
622615
sscf->early_data = NGX_CONF_UNSET;
623616
sscf->reject_handshake = NGX_CONF_UNSET;
@@ -649,17 +642,6 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
649642

650643
ngx_pool_cleanup_t *cln;
651644

652-
if (conf->enable == NGX_CONF_UNSET) {
653-
if (prev->enable == NGX_CONF_UNSET) {
654-
conf->enable = 0;
655-
656-
} else {
657-
conf->enable = prev->enable;
658-
conf->file = prev->file;
659-
conf->line = prev->line;
660-
}
661-
}
662-
663645
ngx_conf_merge_value(conf->session_timeout,
664646
prev->session_timeout, 300);
665647

@@ -714,37 +696,7 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
714696

715697
conf->ssl.log = cf->log;
716698

717-
if (conf->enable) {
718-
719-
if (conf->certificates) {
720-
if (conf->certificate_keys == NULL) {
721-
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
722-
"no \"ssl_certificate_key\" is defined for "
723-
"the \"ssl\" directive in %s:%ui",
724-
conf->file, conf->line);
725-
return NGX_CONF_ERROR;
726-
}
727-
728-
if (conf->certificate_keys->nelts < conf->certificates->nelts) {
729-
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
730-
"no \"ssl_certificate_key\" is defined "
731-
"for certificate \"%V\" and "
732-
"the \"ssl\" directive in %s:%ui",
733-
((ngx_str_t *) conf->certificates->elts)
734-
+ conf->certificates->nelts - 1,
735-
conf->file, conf->line);
736-
return NGX_CONF_ERROR;
737-
}
738-
739-
} else if (!conf->reject_handshake) {
740-
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
741-
"no \"ssl_certificate\" is defined for "
742-
"the \"ssl\" directive in %s:%ui",
743-
conf->file, conf->line);
744-
return NGX_CONF_ERROR;
745-
}
746-
747-
} else if (conf->certificates) {
699+
if (conf->certificates) {
748700

749701
if (conf->certificate_keys == NULL
750702
|| conf->certificate_keys->nelts < conf->certificates->nelts)
@@ -1030,26 +982,6 @@ ngx_http_ssl_compile_certificates(ngx_conf_t *cf,
1030982
}
1031983

1032984

1033-
static char *
1034-
ngx_http_ssl_enable(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1035-
{
1036-
ngx_http_ssl_srv_conf_t *sscf = conf;
1037-
1038-
char *rv;
1039-
1040-
rv = ngx_conf_set_flag_slot(cf, cmd, conf);
1041-
1042-
if (rv != NGX_CONF_OK) {
1043-
return rv;
1044-
}
1045-
1046-
sscf->file = cf->conf_file->file.name.data;
1047-
sscf->line = cf->conf_file->line;
1048-
1049-
return NGX_CONF_OK;
1050-
}
1051-
1052-
1053985
static char *
1054986
ngx_http_ssl_password_file(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1055987
{

src/http/modules/ngx_http_ssl_module.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616

1717
typedef struct {
18-
ngx_flag_t enable;
19-
2018
ngx_ssl_t ssl;
2119

2220
ngx_flag_t prefer_server_ciphers;
@@ -64,9 +62,6 @@ typedef struct {
6462
ngx_flag_t stapling_verify;
6563
ngx_str_t stapling_file;
6664
ngx_str_t stapling_responder;
67-
68-
u_char *file;
69-
ngx_uint_t line;
7065
} ngx_http_ssl_srv_conf_t;
7166

7267

src/http/ngx_http_core_module.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4176,6 +4176,11 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
41764176

41774177
if (ngx_strcmp(value[n].data, "http2") == 0) {
41784178
#if (NGX_HTTP_V2)
4179+
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
4180+
"the \"listen ... http2\" directive "
4181+
"is deprecated, use "
4182+
"the \"http2\" directive instead");
4183+
41794184
lsopt.http2 = 1;
41804185
continue;
41814186
#else

0 commit comments

Comments
 (0)