https://nginx.org/en/docs/http/ngx_http_v2_module.html#:~:text=Sets%20the%20maximum%20number%20of%20concurrent%20HTTP%2F2%20streams,limit%20applies%20equally%20to%20both%20name%20and%20value.
Known Issues
Example Configuration
Directives
     http2
     http2_body_preread_size
     http2_chunk_size
     http2_idle_timeout
     http2_max_concurrent_pushes
     http2_max_concurrent_streams
     http2_max_field_size
     http2_max_header_size
     http2_max_requests
     http2_push
     http2_push_preload
     http2_recv_buffer_size
     http2_recv_timeout
Embedded Variables

The ngx_http_v2_module module (1.9.5) provides support for HTTP/2.

This module is not built by default, it should be enabled with the --with-http_v2_module configuration parameter.

Known Issues

Before version 1.9.14, buffering of a client request body could not be disabled regardless of proxy_request_bufferingfastcgi_request_bufferinguwsgi_request_buffering, and scgi_request_buffering directive values.

Before version 1.19.1, the lingering_close mechanism was not used to control closing HTTP/2 connections.

Example Configuration

server {
listen 443 ssl; http2 on; ssl_certificate server.crt;
ssl_certificate_key server.key;
}

Note that accepting HTTP/2 connections over TLS requires the “Application-Layer Protocol Negotiation” (ALPN) TLS extension support, which is available since OpenSSL version 1.0.2.

Also note that if the ssl_prefer_server_ciphers directive is set to the value “on”, the ciphers should be configured to comply with RFC 9113, Appendix A black list and supported by clients.

Directives

Syntax: http2 on | off;
Default:
http2 off;
Context: httpserver

This directive appeared in version 1.25.1.

Enables the HTTP/2 protocol.

Syntax: http2_body_preread_size size;
Default:
http2_body_preread_size 64k;
Context: httpserver

This directive appeared in version 1.11.0.

Sets the size of the buffer per each request in which the request body may be saved before it is started to be processed.

Syntax: http2_chunk_size size;
Default:
http2_chunk_size 8k;
Context: httpserverlocation

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 HOL blocking.

Syntax: http2_idle_timeout time;
Default:
http2_idle_timeout 3m;
Context: httpserver

This directive is obsolete since version 1.19.7. The keepalive_timeout directive should be used instead.

Sets the timeout of inactivity after which the connection is closed.

Syntax: http2_max_concurrent_pushes number;
Default:
http2_max_concurrent_pushes 10;
Context: httpserver

This directive appeared in version 1.13.9.

This directive is obsolete since version 1.25.1.

Limits the maximum number of concurrent push requests in a connection.

Syntax: http2_max_concurrent_streams number;
Default:
http2_max_concurrent_streams 128;
Context: httpserver

Sets the maximum number of concurrent HTTP/2 streams in a connection.

Syntax: http2_max_field_size size;
Default:
http2_max_field_size 4k;
Context: httpserver

This directive is obsolete since version 1.19.7. The large_client_header_buffers directive should be used instead.

Limits the maximum size of an HPACK-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.

Syntax: http2_max_header_size size;
Default:
http2_max_header_size 16k;
Context: httpserver

This directive is obsolete since version 1.19.7. The large_client_header_buffers directive should be used instead.

Limits the maximum size of the entire request header list after HPACK decompression. For most requests, the default limit should be enough.

Syntax: http2_max_requests number;
Default:
http2_max_requests 1000;
Context: httpserver

This directive appeared in version 1.11.6.

This directive is obsolete since version 1.19.7. The keepalive_requests directive should be used instead.

Sets the maximum number of requests (including push requests) that can be served through one HTTP/2 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.

Syntax: http2_push uri | off;
Default:
http2_push off;
Context: httpserverlocation

This directive appeared in version 1.13.9.

This directive is obsolete since version 1.25.1.

Pre-emptively sends (pushes) a request to the specified uri 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 uri value can contain variables.

Several http2_push directives can be specified on the same configuration level. The off parameter cancels the effect of the http2_push directives inherited from the previous configuration level.

Syntax: http2_push_preload on | off;
Default:
http2_push_preload off;
Context: httpserverlocation

This directive appeared in version 1.13.9.

This directive is obsolete since version 1.25.1.

Enables automatic conversion of preload links specified in the “Link” response header fields into push requests.

Syntax: http2_recv_buffer_size size;
Default:
http2_recv_buffer_size 256k;
Context: http

Sets the size of the per worker input buffer.

Syntax: http2_recv_timeout time;
Default:
http2_recv_timeout 30s;
Context: httpserver

This directive is obsolete since version 1.19.7. The client_header_timeout directive should be used instead.

Sets the timeout for expecting more data from the client, after which the connection is closed.

Embedded Variables

The ngx_http_v2_module module supports the following embedded variables:

$http2
negotiated protocol identifier: “h2” for HTTP/2 over TLS, “h2c” for HTTP/2 over cleartext TCP, or an empty string otherwise.

[转帖]Module ngx_http_v2_module的更多相关文章

  1. Module ngx_http_v2_module

    官方配置说明: http://nginx.org/en/docs/http/ngx_http_v2_module.html#example ngx_http_v2_module模块指令中文说明 ngx ...

  2. Fundebug网站升级HTTP/2,真的变快了!

    作为新一代的HTTP协议,HTTP/2可以提高网站性能,优化用户体验,Fundebug也是时候升级HTTP/2了,虽然已经有点晚了. 升级HTTP/2是一件很简单的事情,改1行Nginx配置就好了,但 ...

  3. [转帖]Nginx Image Module图片缩略图 水印处理模块

    Nginx Image Module图片缩略图 水印处理模块 https://www.cnblogs.com/jicki/p/5546972.html Nginx Image Module图片缩略图 ...

  4. AndroidStudio权威教程 AS添加第三方库的6种方式(Jar module so等)

    点击项目设置按钮 依次选择 App > Dependencies 1. 直接搜索法 依次选择 + > Library dependency 这里的搜索一定要是全名的,不然搜不到哦 下图所表 ...

  5. [转帖]IIS7.5应用程序池集成模式和经典模式的区别介绍

    IIS7.5应用程序池集成模式和经典模式的区别介绍 之前转帖过一个 但是感觉不如这个说的细: https://www.jb51.net/article/31010.htm 关注脚本之家微信公众号(jb ...

  6. LowDB采坑记录(主要为lowdb3.0的Cannot find module和lowdb1.0 node不断自启动的问题)

    bug1: Error [ERR_ MODULE_ NOT_ FOUND]: Cannot find module 在使用最新版LowDB(3.0)时,发现typescript中直接引用模块名(如以下 ...

  7. Android Studio 编译单个module

    前期自己要把gradle环境变量配置好 在Terminal中gradle命令行编译apk 输入gradle assembleRelease 会编译全部module编译单个modulecd ./xiru ...

  8. ABP源码分析三:ABP Module

    Abp是一种基于模块化设计的思想构建的.开发人员可以将自定义的功能以模块(module)的形式集成到ABP中.具体的功能都可以设计成一个单独的Module.Abp底层框架提供便捷的方法集成每个Modu ...

  9. nodejs模块中exports和module.exports的区别

    通过Node.js的官方API可以看到Node.js本身提供了很多核心模块 http://nodejs.org/api/ ,这些核心模块被编译成二进制文件,可以require('模块名')去获取:核心 ...

  10. ES6之module

    该博客原文地址:http://www.cnblogs.com/giggle/p/5572118.html 一.module概述 JavaScript一直没有模块体系,但是伴随着ES6的到来,modul ...

随机推荐

  1. Shiro 的基本使用

    简介 Apache Shiro 是一个强大的.灵活的开源安全框架,可以干净地处理验证.授权.企业会话管理和加密等功能 相关特性 Apache Shiro 具有的主要特性如下图所示: 主要关注的地方在于 ...

  2. [LitCTF 2023]1zjs

    打开环境: 一个魔方♂ 习惯性打开 F12,之后发现有个./dist/index.umd.js Ctrl u 打开 把这个蓝色的点开 0.o? 这里眼神好的话就能看到有个" /f@k3f1a ...

  3. 《架构整洁之道》学习笔记 Part 1 概述

    本书主题 介绍什么是优秀的软件架构,以提高软件架构质量 介绍系统架构的各种属性与成本和生产力的关系,以采用好的设计和架构以便减少构建成本 好的软件架构可以带来什么? 大大节省软件项目构建与维护的人力成 ...

  4. JS的深浅复制,原来如此!

    摘要:之所以会出现深浅拷贝的问题,实质上是由于JS对基本类型和引用类型的处理不同. 本文分享自华为云社区<js的深浅复制,一看就明白>,作者: 鑫2020. 浅复制的意思 浅复制是仅仅对数 ...

  5. 有什么好用的C/C++源代码混淆工具?

    开始使用ipaguard 前言 iOS加固保护是直接针对ios ipa二进制文件的保护技术,可以对iOS APP中的可执行文件进行深度混淆.加密.使用任何工具都无法逆向.破解还原源文件.对APP进行完 ...

  6. 不知如何优选达人?火山引擎 VeDI 零售行业解决方案一键解决!

      技术交流.求职机会,欢迎关注字节跳动数据平台微信公众号,回复[1]进入官方交流群 "人-货匹配"这句营销老话,在直播电商兴起的这几年,似乎不再专指消费者与商品之间的关系. 过去 ...

  7. 火山引擎A/B测试:MAB智能调优实验,企业活动效果提升新利器

      618临近,各大电商APP的预热活动已然拉开序幕.对企业而言,一场活动从策划到上线,中间经过效果验证,其业务成本很高.一个好的活动创意从策划.开发.到最终发布,至少会经历几周实践,如果中间还经历A ...

  8. Axure 弹出框遮罩层灯箱效果

    灯箱效果:比较适合Web, 效果不太理想,还是自己做个比较合适 弹出效果:就是弹框 推动效果:A 元件显示的时候,把 B元件往下.右移动.如Web左侧菜二级单效果

  9. 震惊!二狗子的火锅店被隔壁老王 DDoS 攻击了

    近两年,游戏出海已经成为了出海热潮中的一员.在"后宅经济时代"的影响下,也得益于海外市场的互联网人口,游戏出海涨势非常迅猛.部分游戏在短时间内走红后,就会遭到了一些"有心 ...

  10. js import的几种用法

    最近昨天公司小朋友离职,临时接收其负责的vue前端项目.vue好久没做了,很多东西都忘记或以前也没接触,几天开始慢慢写点vue的小知识,算是历程或备忘吧. import在js.ts中用了不知多少次,但 ...