I am trying to use http/2 for everything except Safari because of some strange behavior we are seeing when using http/2 with any version of Safari we have handy. I cannot figure out how to set up Apache to allow it, however. Can anyone shed some light on why the following doesn't work?
BrowserMatchNoCase Safari NOHTTP2
# Chrome includes both Safari and Mozilla in its User Agent
BrowserMatchNoCase Chrome !NOHTTP2
<IfDefine NOHTTP2>
Protocols http/1.1
</IfDefine>
<IfDefine !NOHTTP2>
Protocols h2 h2c http/1.1
</IfDefine>
That is currently in /etc/apache2/mods-enabled/http2.conf
. I have no experience with IfDefine
or BrowserMatch
, so I'm not sure if I am doing this correctly (given that it isn't working, it would seem I am not). Every browser I test it on still has http/2 enabled with the above config as well as any others I have tested.
I have also tried SetEnvIfNoCase User-Agent
instead of BrowserMatch
, and various options other than IfDefine
such as If
and Directory
, but all of these throw "Protocols not allowed here" errors when running the configtest.
I am running Apache 2.4.25 on Debian 9.6.