HTTP/2 in nginx needs TLS and a recent build

HTTP/2 does not require encryption in the specification and does in every browser, so in practice it arrives with the certificate. nginx 1.9.5 replaced the SPDY module with an HTTP/2 one, and the directive changed with it.

server {
    listen 443 ssl http2;
    server_name shop.example.com;

    ssl_certificate     /etc/letsencrypt/live/shop.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/shop.example.com/privkey.pem;
}

The optimisations built up for HTTP/1 become counterproductive: concatenating scripts and sharding assets across domains both fight multiplexing, and inlining images as data URIs still does. Undoing them is worth measuring rather than assuming — on a site with few requests the difference is small either way. Check nginx -V before debugging a config that looks right; the Ubuntu 14.04 package is too old to have the module at all.