How to Enable HTTP2 Protocol with Nginx on Debian 8 Jessie Server

This tutorial will be showing you how to enable HTTP/2 protocol with Nginx on a Debian 8 server to speed up web page loading. There are 2 requirements.

Nginx version 1.9.5 or above, built with OpenSSL 1.0.2

HTTPS enabled

Let’s tackle these one by one.

Installing Nginx from Jessie Backports Repo

ALPN (Application Layer Protocol Negotiation) is a TLS extension that allows servers to negotiate HTTP/2 protocol with web browsers. Without ALPN, HTTP/2 connection can not be established, even if both web server and web browser support HTTP/2. The OpenSSL library supports ALPN stating with version 1.0.2.

Debian 8 has OpenSSL 1.0.1. To check your OpenSSL version, run

openssl version

Please note that there’s no need to install OpenSSL 1.0.2 on the system. We only need Nginx 1.9.5 or above that’s built with OpenSSL 1.0.2. Nginx added support for HTTP/2 in version 1.9.5. The default Debian 8 repo has Nginx 1.6.2. Fortunately, Jessie backports repo provides Nginx 1.10.3 built with OpenSSL 1.0.2l.

To add this repository, create a source list file.

sudo nano /etc/apt/sources.list.d/jessie-backports.list

Add the following line to this file.

deb http://ftp.debian.org/debian jessie-backports main

Save and close the file. Then update package index and install Nginx from Jessie backports repository.

Note that you may need to clear your browser’s cache because cached objects may be mistakenly marked with HTTP/1.1 protocol.

Improvements

The Certbot Nginx plugin is still not mature. I got B on SSL Labs test after using Nginx plugin because of the use of weak key exchange parameters. The Mozilla SSL configuration generator is a good tool to help you create modern SSL configurations.

That’s it! I hope this tutorial helped you enable HTTP/2 with Nginx on Debian 8 server. As always, if you found this post useful, then subscribe to our free newsletter.