server {
# http/3
listen 443 quic reuseport;
#quic_retry on; # 启用QUIC重试机制,增强连接的稳定性
ssl_early_data on; # 启用SSL早期数据支持,允许0-RTT重连,提高连接速度
# quic_gso on; # 启用QUIC的分段卸载,有助于减少CPU负载
add_header alt-svc 'h3=":443"; ma=86400'; # 添加Alt-Svc头部,协商HTTP/3
# Sent when QUIC was used
add_header QUIC-Status $http3; # 用QUIC时发送此头部
add_header x-quic 'h3';
# http/2 and http/1.1
listen 443 ssl;
http2 on;
}
测试
https://http3.wcode.net/?q=
https://http3check.net/?host=
|