How to install nginx 1.9.5 with HTTP2 support on Ubuntu 14.04 LTS

Since HTTP2 was published as RFC 7540 in May 2015 you should really consider using it for your website. HTTP2 allows you to load many assets of your website using a single connection which gives a lot of speed improvements to your website.

HTTP2 is included in nearly every current browser, so you will get fast results migrating to HTTP2.

In September nginx announced that their current version of their web server now supports HTTP2, so it is really easy to install your nginx web server with HTTP2 support:

Create the file /etc/apt/sources.list.d/nginx.list with the following content:

If done so, add the nginx signing key to avoid errors:

Next you can install nginx:

If there is no old nginx on your machine, this should be no problem. If there is any, be prepared to fix some config errors.

That’s it. Now you have your running nginx 1.9.5 (when writing this article) instance that supports the HTTP2 protocol.

To enable it, go to your sites HTTPS config blog and put the keyword http2 to your listen directive:

Some warnings:

  • when installing the new nginx version with HTTP2 support, the spdy-support is completely removed. You should set this apart.
  • HTTP2 only works on HTTPS connections. The HTTP2 standard also allows HTTP2 connections without HTTPS, but there is no browser or server that is currently supporting unencrypted HTTP. So you need a SSL certificate to enjoy the benefit of performance improvements.

7 thoughts on “How to install nginx 1.9.5 with HTTP2 support on Ubuntu 14.04 LTS

Leave a Reply

Your email address will not be published. Required fields are marked *