comparison src/http/ngx_http_core_module.c @ 9119:08ef02ad5c54

HTTP/2: "http2" directive. The directive enables HTTP/2 in the current server. The previous way to enable HTTP/2 via "listen ... http2" is now deprecated. The new approach allows to share HTTP/2 and HTTP/0.9-1.1 on the same port. For SSL connections, HTTP/2 is now selected by ALPN callback based on whether the protocol is enabled in the virtual server chosen by SNI. This however only works since OpenSSL 1.0.2h, where ALPN callback is invoked after SNI callback. For older versions of OpenSSL, HTTP/2 is enabled based on the default virtual server configuration. For plain TCP connections, HTTP/2 is now auto-detected by HTTP/2 preface, if HTTP/2 is enabled in the default virtual server. If preface is not matched, HTTP/0.9-1.1 is assumed.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 16 May 2023 16:30:08 +0400
parents 69bae2437d74
children 73eb75bee30f
comparison
equal deleted inserted replaced
9118:b4a57278bf24 9119:08ef02ad5c54
4174 #endif 4174 #endif
4175 } 4175 }
4176 4176
4177 if (ngx_strcmp(value[n].data, "http2") == 0) { 4177 if (ngx_strcmp(value[n].data, "http2") == 0) {
4178 #if (NGX_HTTP_V2) 4178 #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
4179 lsopt.http2 = 1; 4184 lsopt.http2 = 1;
4180 continue; 4185 continue;
4181 #else 4186 #else
4182 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 4187 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
4183 "the \"http2\" parameter requires " 4188 "the \"http2\" parameter requires "