fetzi.dev

HTTP/2 NOW!

2 minutes

Yesterday I heard a great keynote about the current status of HTTP/2 at the Topconf conference in Linz, Austria. In the evening I tried to upgrade my website to use HTTP/2.

Amazingly, I was able to update my webserver within 2 or 3 minutes by executing one software update command and one small configuration change in my nginx config.

NGINX Version Upgrade

To be able to use HTTP/2 you need at least nginx version 1.9.5 (mine was at 1.6.x). This update can be easily executed by calling apt-get update && apt-get install nginx.

NGINX Configuration

To tell the webserver to communicate via HTTP/2 you simply need to add the http2 directive to the listen command in your host configuration file (e.g. listen 443 ssl http2;

After restarting nginx your website users will benefit of the amazing changes in HTTP/2.

The ALPN problem

One problem with the enforced HTTP/2 implementation by the main browsers is that at first an ALPN request is sent to the server to determine whether to use HTTP/2 or to stick to the HTTP/1.1 standard implementation.

This ALPN request cannot be handled by the server at the moment because the latest available version of OpenSSL (1.0.1) does not support this technique. One option would be to compile the current OpenSSL version 1.0.2 manually and also build the nginx webserver with the --with-openssl flag that points to the manually compiled version of OpenSSL.

But for the moment this restriction is not a problem at all because all HTTP/2 compatible browser support support the NPN request. (the predecessor version of ALPN).

If you want to get information about the changes made in HTTP/2 you can read the Blog Post by undertow.

Do you enjoy reading my blog?

sponsor me at ko-fi