我按照以下设置我的 Nginx 配置数字海洋纸 https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-with-http-2-support-on-ubuntu-16-04,
现在 http2 可用了。
但在 Chrome(版本 54.0.2840.98(64 位))开发工具中,它始终位于 HTTP 1/1:
NAME METHOD STATUS PROTOCOL
shell.js?v=xx.. GET 200 http/1/1
我的服务器运行的是 Ubuntu 16.04 LTS,它支持 ALPN 和 NPN,附带的 openssl 版本是 1.0.2g。
我检查了 http2 支持这个工具网站 https://tools.keycdn.com/http2-test结果是:
Yeah! example.com supports HTTP/2.0. ALPN supported...
还用curl检查是否可以:
$ curl -I --http2 https://www.example.com
HTTP/2 200
server: nginx/1.10.0 (Ubuntu)
date: Tue, 13 Dec 2016 15:59:13 GMT
content-type: text/html; charset=utf-8
content-length: 5603
x-powered-by: Express
cache-control: public, max-age=0
etag: W/"15e3-EUyjnNnyevoQO+tRlVVZxg"
vary: Accept-Encoding
strict-transport-security: max-age=63072000; includeSubdomains
x-frame-options: DENY
x-content-type-options: nosniff
我还从控制台检查了 is-http2 cli:
is-http2 www.amazon.com
× HTTP/2 not supported by www.amazon.com
Supported protocols: http/1.1
is-http2 www.example.com
✓ HTTP/2 supported by www.example.com
Supported protocols: h2 http/1.1
为什么 Chrome 无法识别它?
如何使用 Safari (v 10.0.1) 也进行检查?