模块 ngx_http_v3_module
已知问题 示例配置 Directives http3 http3_hq http3_max_concurrent_streams http3_stream_buffer_size quic_active_connection_id_limit quic_bpf quic_gso quic_host_key quic_retry 嵌入变量 |
模块 (1.25.0) 提供
对 HTTP/3 的实验性支持。ngx_http_v3_module
这个模块不是默认构建的,它应该使用 --with-http_v3_module
配置参数来启用。
提供 QUIC 支持的 SSL 库 例如 BoringSSL、LibreSSL 或 QuicTLS 来构建和运行此模块。 否则 使用 OpenSSL 库时, 将使用不支持早期数据的 OpenSSL 兼容层。
已知问题
该模块是实验性的,需要注意购买者。
示例配置
http { log_format quic '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent" "$http3"'; access_log logs/access.log quic; server { # for better compatibility it's recommended # to use the same port for http/3 and https listen 8443 quic reuseport; listen 8443 ssl; ssl_certificate certs/example.com.crt; ssl_certificate_key certs/example.com.key; location / { # used to advertise the availability of HTTP/3 add_header Alt-Svc 'h3=":8443"; ma=86400'; } } }
请注意,通过 TLS 接受 HTTP/3 连接需要 TLSv1.3 协议支持,自 OpenSSL 版本 1.1.1 起提供。
Directives
语法: |
http3 |
---|---|
默认值: |
http3 on; |
上下文: |
http ,server |
启用 HTTP/3 协议协商。
语法: |
http3_hq |
---|---|
默认值: |
http3_hq off; |
上下文: |
http ,server |
启用 HTTP/0.9 协议协商 用于 QUIC 互作性测试。
语法: |
http3_max_concurrent_streams |
---|---|
默认值: |
http3_max_concurrent_streams 128; |
上下文: |
http ,server |
设置并发 HTTP/3 请求流的最大数量 在连接中。
语法: |
http3_stream_buffer_size |
---|---|
默认值: |
http3_stream_buffer_size 64k; |
上下文: |
http ,server |
设置用于读取和写入 QUIC 流。
语法: |
quic_active_connection_id_limit |
---|---|
默认值: |
quic_active_connection_id_limit 2; |
上下文: |
http ,server |
设置
QUIC 传输参数值。
这是客户端连接 ID 的最大数量
可以存储在服务器上。active_connection_id_limit
语法: |
quic_bpf |
---|---|
默认值: |
quic_bpf off; |
上下文: |
main |
启用使用 eBPF 的 QUIC 数据包路由。 启用后,这将允许支持 QUIC 连接迁移。
该Directives仅在 Linux 5.7+ 上受支持。
语法: |
quic_gso |
---|---|
默认值: |
quic_gso off; |
上下文: |
http ,server |
支持以优化的批处理模式发送 使用分段卸载。
仅在 Linux 上支持优化发送
具有。UDP_SEGMENT
语法: |
quic_host_key |
---|---|
默认值: | — |
上下文: |
http ,server |
使用 secret 密钥设置 a 用于加密
无状态重置和地址验证令牌。
默认情况下,每次重新加载时都会生成一个随机键。
不接受使用旧密钥生成的令牌。file
语法: |
quic_retry |
---|---|
默认值: |
quic_retry off; |
上下文: |
http ,server |
启用 QUIC
地址验证功能。
这包括在数据包中发送新令牌
或框架
和
验证数据包中收到的令牌。Retry
NEW_TOKEN
Initial
嵌入变量
模块
支持以下嵌入变量:ngx_http_v3_module
$http3
- 协商协议标识符:
“” 用于 HTTP/3 连接,
“” 对于 HQ 连接,
否则为空字符串。
h3
hq