Nginx began to provide early support for HTTP/2
In Early August, the official Nginx blog published an article: "Announcing an Early Alpha Patch for HTTP/2", which means Nginx finally began to provide Early (Early Alpha) services for HTTP/2) yes. There is no reason for me not to try this kind of personal blog that focuses on hard work.
Nginx adds the http_v2_module module to provide HTTP/2 services. This module is provided in the form of patches. There are three official notes:
- It is strongly not recommended for use in the production environment;
- Currently, Server Push is not supported;
- This Patch replaces the previous SPDY module, that is, the spdy cannot be configured for the site after the Patch is applied;
After introducing the basic information, let's briefly write down how to make Nginx Support HTTP/2:
Currently, the HTTP/2 patch requires Nginx 1.9.0 or later. We recommend that you download the latest source code package (1.9.3 currently) from the Nginx official website and then use OpenSSL or LibreSSL (LibreSSL is used) download the latest SSL source code package from the official website and decompress it separately.
Next, go to the decompressed Nginx source code directory and download and apply the patch:
cd nginx-1.9.3
wget http://nginx.org/patches/http2/patch.http2.txt
patch -p1 < patch.http2.txt
At least the http_v2_module and http_ssl_module modules must be enabled during configuration:
./configure --with-openssl=../libressl-2.2.2--with-http_v2_module --with-http_ssl_module
Thenmake
Andmake install
That's it. In Nginx configuration, enabling site support for HTTP/2 is also very convenient.listen
Addhttp2
You can, for example:
listen 443 ssl http2 fastopen=3 reuseport;
Other articles have been written before configuration. In addition, because HTTP/2 does not use gzip to compress the headerspdy_headers_comp
The configuration is no longer required.http2_headers_comp
.
After a day's simple trial, I found that Nginx is stable with HTTP/2 patch, so I will use it like this first, and I will try again later.
Update @ 17/08: My blog is inaccessible in firefox today (I tested OSX 10.11 EI Capitan and Windows 10). The connection is terminated in the TLS handshake phase. No problem with other browsers. Removing the support for HTTP/2 in Nginx configuration can also restore firefox to normal. I have not found the reason for this problem. I decided to roll back to the H2O version first, and I will try again later.
For more Nginx tutorials, see the following:
Deployment of Nginx + MySQL + PHP in CentOS 6.2
Build a WEB server using Nginx
Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5
Performance Tuning for Nginx in CentOS 6.3
Configure Nginx to load the ngx_pagespeed module in CentOS 6.3
Install and configure Nginx + Pcre + php-fpm in CentOS 6.4
Nginx installation and configuration instructions
Nginx log filtering using ngx_log_if does not record specific logs
Nginx details: click here
Nginx: click here
This article permanently updates the link address: