I found the hint about http/2 in the new admin manuel here and also enabled it for my server by:
$ a2enmod http2
And adding:
<IfModule http2_module>
ProtocolsHonorOrder On
Protocols h2 http/1.1
</IfModule>
to my vhosts.
I got the quick guide from here.
Different checks by browser and testing websites confirm that everything is working fine so far. But I have some questions:
-
I have two vhosts, one for http requests over port 80 and one for https requests over port 443. Just the standard apache2 setup on raspbian ;). Is it true, that the h2 protocol only works (or only make sense) in the 443 vhost and why? I added the code above also to the 80 vhost and didn’t found any problem accessing my nextcloud without explicit “https://” in adress field. But I anyway configured permanent redirect to https, so maybe this skips possible problems.
-
What actually does
ProtocolsHonorOrder On? Does it force to try the protocols in the given orden, so in my case first h2, and only if it doesn’t work it will fall back to http/1.1? -
I also found the h2c protocol, which is advised to use in the basic apache.conf. So is it maybe easier to just add
Protocols h2 h2c http/1.1to the apache.conf itself, if I anyway want to use http2 everywhere possible? -
I also found the
H2PushandH2Directsyntax, which can further improve performance according to some guides. H2Direct seems to be enabled by default for h2c protocol but not for h2. I didn’t understand what it actually does and if it is also useful to enable für h2. Maybe someone can explain this for me?
H2Push seems to be enabled by default anyway.
I hope someone here has some deeper knowledge about http/2 and it’s possible settings. The official documentation didn’t really help me.