Nginx began to provide early support for HTTP/2

Source: Internet
Author: User

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:

  1. cd nginx-1.9.3
  2. wget http://nginx.org/patches/http2/patch.http2.txt
  3. patch -p1 < patch.http2.txt

At least the http_v2_module and http_ssl_module modules must be enabled during configuration:

  1. ./configure --with-openssl=../libressl-2.2.2--with-http_v2_module --with-http_ssl_module

ThenmakeAndmake installThat's it. In Nginx configuration, enabling site support for HTTP/2 is also very convenient.listenAddhttp2You can, for example:

  1. 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_compThe 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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.