| 协商检查 | s_client -alpn h2 观察 ALPN 结果 |
|---|---|
| nginx 指令 | 1.25.1 起使用 http2 on;旧版本为 listen 443 ssl http2 |
| 回源 | proxy_pass 默认走 HTTP/1.x,上游 h2 需要额外支持 |
验证 h2 协商
验证 h2 协商
openssl s_client -connect example.com:443 -servername example.com -alpn h2 </dev/null 2>&1 | grep -i 'ALPN'
curl -sI --http2 https://example.com/ | head -3
curl -so /dev/null -w '%{http_version}\n' https://example.com/nginx 配置
nginx 配置
listen 443 ssl;
http2 on; # nginx 1.25.1 起;旧版本写 listen 443 ssl http2;升级 nginx 前后注意 http2 指令兼容性,变更后用 nginx -t 校验并复测协商结果。