Unable to disable HTTP2 on Virtual Server

SYSTEM INFORMATION||

OS type and version: Rocky 9.1
Virtualmin version: 7.5

I have set up a simple server (speedtest.aiskon.net) that has the open source project OpenSpeedTest loaded - it’s an HTML 5 app that helps you test network speed (locally on your LAN, across the web, etc.)

One of the things noted with it is that HTTP2 needs to be disabled for it to work properly. In Virtualmin, I go to Server Configuration => Website Options, and when I change “Enable HTTP2 protocol support” to No, I get one of two results:

  1. “No changes were made to PHP configuration …skipping”
  2. I make an additional change, save it, and when I go back to check, the option is still on “Default (Yes)”

I get the feeling this is just a simple UI bug? Am I missing something, or is there another way to disable HTTP2 ?

Looks like a bug, I get the same thing on Rock9, HTTP/2 Test - Verify HTTP/2 Support | KeyCDN Tools is saying it still supported.

If you go Yes then No it does saying its disabling but reload the page its back to Yes

1 Like

From what I read you can disable it here, but its a global setting. Leave only http/1.1

Thank you for the confirmation. Is there a formal process to submit a bug, or is reporting it here enough?

I just say @staff we have found a bug.

This does look like a bug, yeah. Is the HTTP2 perhaps enabled globally in your Apache config outside of any VirtualHost?

Its enabled globally yes, that’s how it installs with Rocky9.
Bingo, that fixed it, disabling Apaches http2 global settings now allows it to be turned off and on in the virtual server.
http2 default has changed from Yes to No.

@Jamie, yes, it is a bug.

This patch should fix it:

1 Like

I added fix, one small issue still if I go from Default(Yes) to No it fails
image
image
But if I go from Default(Yes) to Yes and save then to No and save it works.
And the toggling Between Yes and No works (not use the Default(yes).

I’m pretty sure I changed the code ok, and I can see the push(@$prots, “http/1.1”); should fix the no.

I reverted that patch, and checked in this simpler one that fixes it : Fix turning off of HTTP 2 · virtualmin/virtualmin-gpl@1fb7f8a · GitHub

1 Like

That fixed it, thanks.

I reverted that patch, and checked in this simpler one that fixes it : Fix turning off of HTTP 2 · virtualmin/virtualmin-gpl@1fb7f8a · GitHub

@Jamie, unfortunately this patch is not entirely correct. If we have HTTP2 explicitly disabled first, i.e.:

Protocols http/1.1

… and then a user wants to enable HTTP2, the Apache will end up with incorrect order of directives, i.e.:

Protocols http/1.1 h2 h2c

This is the reason for that additional line of code. Check these two fixes:

Nope, if you properly applied my initial patch, you shouldn’t see mentioned behaviour.

1 Like

What effect does the order of directives have? If we need to be able to control this, the UI will need to be more complex…

The first protocol will be tried, i.e. http/1.1 and HTTP2 will never work?

I think I have also fixed that on the template side in another commit (linked above).

What I meant was, will we ever need the UI to control if h2 comes before http/1.1 , or the other way around?

No, as UI should have just basic options, like ● Default, ○ Yes, ○ No. We do the logic, making sure that http/1.1 always placed after h2. It’s explained and described in Apache docs that protocol order matters:

https://httpd.apache.org/docs/2.4/howto/http2.html#basic-config

Ok, if we know that http/1.1 should always come last, that’s fine.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.