HTTP/2, SSL & Hugo
Jun 2016Given that I don’t write blogs anymore all that often you might have not noticed that I’ve once again made changes to it.
This time I’ve added HTTP/2 support (with SSL of course as that’s a requirement), the site is now also powered by the wonderful Hugo on a new Linode VPS that’s running Debian 8 Jessie.
The theme (now for Hugo) has also been updated and streamlined to be even smaller in file size. In addition to only using SVGs now, so the icons should be as crisp as they possibly can be.
So what were some of the pain (learning) points?
HTTP/2 and Chrome 51+
In order to serve the site over HTTP/2 to Chrome 51 and later versions you need to support something that is called ALPN and I’ll be honest, until recently I didn’t know what ALPN or NPN were.
Suffice to say you need to support ALPN to be future proof (and for Chrome users already now as Google has removed NPN support).
Typically you’d think this wouldn’t be a huge issue as you’d just update to the latest version of nginx and OpenSSL and you’d be all set. But no.
From the major operating systems only Ubuntu 16.04 LTS ships with these new packages that would bring ALPN support. Debian 8 being the OS of my choice for the new server left me to search for a different solution.
What I settled on was to use Debian Stretch repository with apt pinning and selectively upgrade nginx and OpenSSL to versions that do support ALPN and thus Chrome users. You can read more about achieving that over at serverfault.
Let’s Encrypt SSL
Another thing that wasn’t as simple as I thought it would be was the SSL certificate itself, but luckily once again there are plenty of good resources for installing, configuring and fixing SSL certificates.
- How To Secure Nginx with Let’s Encrypt on Ubuntu 16.04 good starting point (keep in mind it’s for Ubuntu though).
- How To Set Up Nginx with HTTP/2 Support on Ubuntu 16.04 is a good article (albeit for Ubuntu, but most things apply to Debian as well).
- Setting up www (and non www) http redirect to non www https another helpful Stack Overflow post about how to set up the redirects correctly in nginx.
With these set of articles and some trial and error I was able to setup SSL & HTTP/2 support on my new Debian server without all too much hassle.
Hugo
As it usually goes with my site renewals I tend to switch the underlying technology usually as well. It all started in 2003 with an entirely static HTML site, to which I added a custom PHP script to write blog posts, after which the whole site was “upgraded” to full custom PHP solution.
And that was only the beginning, as the years passed I switched to WordPress and the site would go through several renewals powered by WordPress.
In late 2013 I decided that I don’t want to use blogging tools (much less CMS platforms) to power my site. There just was no need for all that additional clutter and made the switch to Jekyll.
Couple years (and a little more) passed and I’ve now switched to Hugo which is also a static site generator, but whereas Jekyll is made with Ruby, Hugo uses Go.
Initial thoughts? I like it more than Jekyll. Maybe it’s the performance, maybe it’s just that it’s something new. Or then maybe it’s just that I’m happier with my site than I’ve ever previously been.
What’s next?
Just like most other people who run their own sites, you are quite never done with improving it or changing things. A short todo list and a reminder to myself of what I want to do next on the site:
- Write blog posts; perhaps the most important part, what’s the point if there are no new posts?
- Add social network sharing buttons. Need to figure out an unobtrusive way of making it easier to share posts (should people find them useful).
- Static asset pipeline improvements. Currently there’s some manual work involved in asset minification.
- Deployment (with git hooks?). Would be nice to just git push my changes and the server would take care of the rest.
That’s about that, until next time.