【发布时间】:2017-04-28 05:12:55
【问题描述】:
我按照Digital Ocean paper 设置了我的 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
我的服务器运行的是支持 ALPN 和 NPN 的 Ubuntu 16.04 LTS,它附带的 openssl 版本是 1.0.2g。
我用this tool site检查了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
为什么 Chrome 不能识别它?
如何使用 Safari (v 10.0.1) 进行检查?
【问题讨论】:
-
Stack Overflow 用于编程问题。在Server Fault 上可以更好地处理服务器软件支持(但请先阅读他们的规则!)。
-
好的,谢谢,不知道...移动了我的问题..我会关闭那个
标签: google-chrome nginx webserver http2