我根据 Digital Ocean 论文设置了我的 Nginx conf ,现在 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 支持,结果是:
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
用我的本地主机上的 openssl 测试
$ echo | openssl s_client -alpn h2 -connect www.example.com:443 | grep ALPN
depth=2 O = Digital Signature Trust Co., CN = DST Root CA X3
verify return:1
depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
verify return:1
depth=0 CN = example.com
verify return:1
ALPN protocol: h2
DONE
为什么 Chrome 被抛在了后面?我如何也可以使用 Safari (v 10.0.1) 检查它