=encoding utf-8 =head1 NAME ngx_http_v2_module - Module ngx_http_v2_module =head1 The C module (1.9.5) provides support for L2|https://datatracker.ietf.org/doc/html/rfc7540>. This module is not built by default, it should be enabled with the C<--with-http_v2_module> configuration parameter. =head1 Known Issues Before version 1.9.14, buffering of a client request body could not be disabled regardless of L, L, L, and L directive values. Before version 1.19.1, the L mechanism was not used to control closing HTTPE2 connections. =head1 Example Configuration server { listen 443 ssl; http2 on; ssl_certificate server.crt; ssl_certificate_key server.key; } Note that accepting HTTPE2 connections over TLS requires the “Application-Layer Protocol Negotiation” (ALPN) TLS extension support, which is available since L version 1.0.2. Also note that if the L directive is set to the value “C”, the L should be configured to comply with L black list and supported by clients. =head1 Directives =head2 http2 B http2 I E C> B I B I B I This directive appeared in version 1.25.1. Enables the L2|https://datatracker.ietf.org/doc/html/rfc9113> protocol. =head2 http2_body_preread_size B http2_body_preread_size I>> B I<64k> B I B I This directive appeared in version 1.11.0. Sets the I> of the buffer per each request in which the request body may be saved before it is started to be processed. =head2 http2_chunk_size B http2_chunk_size I>> B I<8k> B I B I B I Sets the maximum size of chunks into which the response body is sliced. A too low value results in higher overhead. A too high value impairs prioritization due to L. =head2 http2_idle_timeout B http2_idle_timeout I>> B I<3m> B I B I B This directive is obsolete since version 1.19.7. The L directive should be used instead. Sets the timeout of inactivity after which the connection is closed. =head2 http2_max_concurrent_pushes B http2_max_concurrent_pushes I>> B I<10> B I B I This directive appeared in version 1.13.9. B This directive is obsolete since version 1.25.1. Limits the maximum number of concurrent push requests in a connection. =head2 http2_max_concurrent_streams B http2_max_concurrent_streams I>> B I<128> B I B I Sets the maximum number of concurrent HTTPE2 streams in a connection. =head2 http2_max_field_size B http2_max_field_size I>> B I<4k> B I B I B This directive is obsolete since version 1.19.7. The L directive should be used instead. Limits the maximum size of an L-compressed request header field. The limit applies equally to both name and value. Note that if Huffman encoding is applied, the actual size of decompressed name and value strings may be larger. For most requests, the default limit should be enough. =head2 http2_max_header_size B http2_max_header_size I>> B I<16k> B I B I B This directive is obsolete since version 1.19.7. The L directive should be used instead. Limits the maximum size of the entire request header list after L decompression. For most requests, the default limit should be enough. =head2 http2_max_requests B http2_max_requests I>> B I<1000> B I B I This directive appeared in version 1.11.6. B This directive is obsolete since version 1.19.7. The L directive should be used instead. Sets the maximum number of requests (including push requests) that can be served through one HTTPE2 connection, after which the next client request will lead to connection closing and the need of establishing a new connection. Closing connections periodically is necessary to free per-connection memory allocations. Therefore, using too high maximum number of requests could result in excessive memory usage and not recommended. =head2 http2_push B http2_push I> E C> B I B I B I B I This directive appeared in version 1.13.9. B This directive is obsolete since version 1.25.1. Pre-emptively sends (L) a request to the specified I> along with the response to the original request. Only relative URIs with absolute path will be processed, for example: http2_push /static/css/main.css; The I> value can contain variables. Several C directives can be specified on the same configuration level. The C parameter cancels the effect of the C directives inherited from the previous configuration level. =head2 http2_push_preload B http2_push_preload I E C> B I B I B I B I This directive appeared in version 1.13.9. B This directive is obsolete since version 1.25.1. Enables automatic conversion of L specified in the C response header fields into L requests. =head2 http2_recv_buffer_size B http2_recv_buffer_size I>> B I<256k> B I Sets the size of the per L input buffer. =head2 http2_recv_timeout B http2_recv_timeout I>> B I<30s> B I B I B This directive is obsolete since version 1.19.7. The L directive should be used instead. Sets the timeout for expecting more data from the client, after which the connection is closed. =head1 Embedded Variables The C module supports the following embedded variables: =over =item C<$http2> negotiated protocol identifier: “C

” for HTTPE2 over TLS, “C” for HTTPE2 over cleartext TCP, or an empty string otherwise. =back