
刚刚给网站升级了 HTTP2 发现一点问题 在 chrome 浏览器下的 Network
发现有的是 HTTP2 有的是 HTTP1
然后我用 Curl 命令查看响应头
~ curl -I https://wujunze.com/ HTTP/1.1 200 OK Server: junze_server Date: Fri, 18 Mar 2016 07:23:06 GMT Content-Type: text/html; charset= Connection: keep-alive Vary: Accept-Encoding X-Powered-By: PHP/7.0.3 X-Pingback: https://wujunze.com/action/xmlrpc 发现是 HTTP1 不太明白是什么原因 请 V 友帮忙看看
我发现我的网站在HTTP/2下的 server是nginx
content-encoding:gzip content-type:text/html; charset= date:Fri, 18 Mar 2016 08:44:46 GMT server:nginx status:200 vary:Accept-Encoding x-pingback:https://wujunze.com/action/xmlrpc x-powered-by:PHP/7.0.3 在HTTP/1下 的server是junze_server
HTTP/1.1 200 OK Server: junze_server Date: Fri, 18 Mar 2016 08:46:53 GMT Content-Type: text/html; charset= Connection: keep-alive Vary: Accept-Encoding X-Powered-By: PHP/7.0.3 X-Pingback: https://wujunze.com/action/xmlrpc 我修改了nginx源码里面的server 名字 为了隐藏服务器信息 安全一点
为什么HTTP/1的server改成功了 HTTP/2的server应该改nginx源码的哪个地方?
1 sparanoid 2016-03-18 15:39:48 +08:00 |
2 v1024 2016-03-18 15:43:43 +08:00 curl 默认命令不支持 http2 , http2 在不支持的浏览器下会自动降级为 1.1 。 |
6 wujunze OP |
7 v1024 2016-03-18 17:07:08 +08:00 @wujunze 改 Server 居然还动了源码… 你可以用插件: https://github.com/openresty/headers-more-nginx-module#more_set_headers |