[转帖]Module ngx_http_v2_module
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.
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_buffering, fastcgi_request_buffering, uwsgi_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 |
|---|---|
| Default: |
http2 off; |
| Context: | http, server |
This directive appeared in version 1.25.1.
Enables the HTTP/2 protocol.
| Syntax: | http2_body_preread_size |
|---|---|
| Default: |
http2_body_preread_size 64k; |
| Context: | http, server |
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 |
|---|---|
| Default: |
http2_chunk_size 8k; |
| Context: | http, server, location |
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 |
|---|---|
| Default: |
http2_idle_timeout 3m; |
| Context: | http, server |
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 |
|---|---|
| Default: |
http2_max_concurrent_pushes 10; |
| Context: | http, server |
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 |
|---|---|
| Default: |
http2_max_concurrent_streams 128; |
| Context: | http, server |
Sets the maximum number of concurrent HTTP/2 streams in a connection.
| Syntax: | http2_max_field_size |
|---|---|
| Default: |
http2_max_field_size 4k; |
| Context: | http, server |
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 |
|---|---|
| Default: |
http2_max_header_size 16k; |
| Context: | http, server |
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 |
|---|---|
| Default: |
http2_max_requests 1000; |
| Context: | http, server |
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 |
|---|---|
| Default: |
http2_push off; |
| Context: | http, server, location |
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 |
|---|---|
| Default: |
http2_push_preload off; |
| Context: | http, server, location |
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 |
|---|---|
| Default: |
http2_recv_buffer_size 256k; |
| Context: | http |
Sets the size of the per worker input buffer.
| Syntax: | http2_recv_timeout |
|---|---|
| Default: |
http2_recv_timeout 30s; |
| Context: | http, server |
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的更多相关文章
- Module ngx_http_v2_module
官方配置说明: http://nginx.org/en/docs/http/ngx_http_v2_module.html#example ngx_http_v2_module模块指令中文说明 ngx ...
- Fundebug网站升级HTTP/2,真的变快了!
作为新一代的HTTP协议,HTTP/2可以提高网站性能,优化用户体验,Fundebug也是时候升级HTTP/2了,虽然已经有点晚了. 升级HTTP/2是一件很简单的事情,改1行Nginx配置就好了,但 ...
- [转帖]Nginx Image Module图片缩略图 水印处理模块
Nginx Image Module图片缩略图 水印处理模块 https://www.cnblogs.com/jicki/p/5546972.html Nginx Image Module图片缩略图 ...
- AndroidStudio权威教程 AS添加第三方库的6种方式(Jar module so等)
点击项目设置按钮 依次选择 App > Dependencies 1. 直接搜索法 依次选择 + > Library dependency 这里的搜索一定要是全名的,不然搜不到哦 下图所表 ...
- [转帖]IIS7.5应用程序池集成模式和经典模式的区别介绍
IIS7.5应用程序池集成模式和经典模式的区别介绍 之前转帖过一个 但是感觉不如这个说的细: https://www.jb51.net/article/31010.htm 关注脚本之家微信公众号(jb ...
- LowDB采坑记录(主要为lowdb3.0的Cannot find module和lowdb1.0 node不断自启动的问题)
bug1: Error [ERR_ MODULE_ NOT_ FOUND]: Cannot find module 在使用最新版LowDB(3.0)时,发现typescript中直接引用模块名(如以下 ...
- Android Studio 编译单个module
前期自己要把gradle环境变量配置好 在Terminal中gradle命令行编译apk 输入gradle assembleRelease 会编译全部module编译单个modulecd ./xiru ...
- ABP源码分析三:ABP Module
Abp是一种基于模块化设计的思想构建的.开发人员可以将自定义的功能以模块(module)的形式集成到ABP中.具体的功能都可以设计成一个单独的Module.Abp底层框架提供便捷的方法集成每个Modu ...
- nodejs模块中exports和module.exports的区别
通过Node.js的官方API可以看到Node.js本身提供了很多核心模块 http://nodejs.org/api/ ,这些核心模块被编译成二进制文件,可以require('模块名')去获取:核心 ...
- ES6之module
该博客原文地址:http://www.cnblogs.com/giggle/p/5572118.html 一.module概述 JavaScript一直没有模块体系,但是伴随着ES6的到来,modul ...
随机推荐
- ubuntu frame 个人开发心得
引言 有一次我在树莓派上安装 Ubuntu Core 我给创新创业项目开发一个可视化 gui 看板,用于展示数据. 然后我就找到了我需要的工具 Ubuntu Frame 初次尝试使用 Ubuntu F ...
- 介绍一个prometheus监控数据生成工具
prometheus-data-generator Prometheus数据模拟工具旨在通过配置文件模拟Prometheus数据,用于测试和开发目的.该工具允许您生成用于测试和开发的合成数据. 配置 ...
- C++ 观察者模式实现
观察者模式 主体(被观察者)通知一个或多个观察者状态改变/数据更新/事件发生. 描述 C++ 实现观察者模式有几个要点: 观察者都有一个共同的抽象基类 Listener,定义了一个纯虚接口 OnNot ...
- 文心一言 VS 讯飞星火 VS chatgpt (52)-- 算法导论6.2 4题
四.当i>A.heap-size/2 时,调用 MAX-HEAPIFY(A,i)会有什么结果? 文心一言: 当 i > A.heap-size/2 时,调用 MAX-HEAPIFY(A, ...
- webrtc实时视频语音实现
webrtc介绍 WebRTC实现了基于网页的视频会议,标准是WHATWG 协议,目的是通过浏览器提供简单的javascript就可以达到实时通讯(Real-Time Communications ( ...
- 华为云如何赋能无人车飞驰?从这群AI热血少年谈起
摘要:由华为云携手上海交通大学学生创新中心举办的"第二届华为云人工智能大赛 · 无人车挑战杯"中,来自电子科技大学的"暑期休闲队"获得大赛季军. 由华为云携手上 ...
- 知识+AI融合创新探索,华为云论文被AI顶级学术期刊IEEE TPAMI接受
摘要:通过利用物体类别之间存在的层级关系约束,自动学习从数据中抽取识别不同类别的规则,一方面对模型的预测过程进行解释,另一方面也提供了一条引入人工先验知识的可行途径. 前言 受益于深度学习技术的突破, ...
- 物联网设备上云难?华为云IoT帮你一键完成模型定义,快速在线调试设备
摘要:在不到3分钟的操作里,不仅完成了一款智慧烟感设备在云端的模型定义,还通过在线调试了解到了设备和远端通信的过程. 本文分享自华为云社区<物联网设备上云难?华为云IoT帮你一键完成模型定义,快 ...
- 可视大盘 + 健康分机制,火山引擎 DataLeap 为企业降低资源优化门槛!
更多技术交流.求职机会,欢迎关注字节跳动数据平台微信公众号,回复[1]进入官方交流群 随着数仓及研发技术团队维护的数据量大.资源使用量大.成本越高.优化压力越大.如何主动发现无效或低效使用的资源,并且 ...
- 取消 SQL Server 密码复杂度
可以先设置一个复杂密码,安装完成后,进入数据库,执行下列命令,关闭复杂密码策略及修改简单密码 ALTER LOGIN sa WITH PASSWORD = '新密码', CHECK_POLICY = ...