Nginx 1.9 支持http2 协议

1,关于HTTP2

最近升级了下nginx,发现原本的spdy支持被移除了,支持http2了。
这个是非常好的消息呢。于是直接编译安装了下。

编译参数:增加了统计和 realip和 http2模块

./configure --with-http_stub_status_module --with-http_realip_module --with-http_v2_module
gmake
gmake install

2,配置

非常简单替换之前的spdy成 http2 即可:

server {
    listen 80 http2;
    server_name  www.demo.com;

...

重启服务即可

3,测试

有网站提供http2 测试。
https://http2-check.com/t/google.com

还有网站专门演示了下http2的效果:
https://http2.akamai.com/demo

4,总结

http2对用户体验非常好,增加上也挺好的。毕竟速度快大家都喜欢。google的浏览器就支持http2。

更多Nginx相关教程见以下内容

Nginx 的详细介绍请点这里
Nginx 的下载地址请点这里

猜你喜欢

转载自www.linuxidc.com/Linux/2016-04/130608.htm