网站安全及https的作用不用再赘述, HTTP2 的http复用还是比较惊喜的. HTTP 2.0

简单记录下安装过程,整个安装过程还是比较简单的.
HTTP2 模块需要openssl-1.0.1 以上版本才可以启用.openssl-1.0.2e.tar.gz

OpenResty 1.9.15以上版本才支持HTTP2(和nginx同步更新),可以在 OpenResty官网 找到.

编译

./configure --prefix=/usr/local/openresty --with-openssl=~/openssl-1.0.2e --with-http_v2_module
make && make install

nginx配置

server
    {
        listen 80;
        server_name insoz.com www.insoz.com;
	return 301 https://$server_name$request_uri;
    }

server {
        listen 443 ssl http2;
        server_name www.insoz.com;
        ssl on;
        ssl_certificate certs/insoz/insoz.pem;
        ssl_certificate_key certs/insoz/insoz.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4:!DH:!DHE;
        ssl_prefer_server_ciphers on;

	add_header Strict-Transport-Security "max-age=31536000;" always;

	index index.html index.htm index.php default.html default.htm default.php;
        root  /data/wwwroot/insoz.com;

        include wordpress.conf;
        include enable-php.conf;


	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

	access_log  /data/wwwlogs/insoz.com.log;
}

PS: 别忘了重启Nginx