Websocket Proxy not working with Firefox

I created a sub-server and activated a proxy path to forward all traffic incl. Websockets to a docker container.

If I open the webpage with Firefox, I see the following message in the developer console:

Firefox can’t establish a connection to the server at wss://test.domainname.de/api/v1/ws

The same problem with Chrome.

Because as a new user I can’t upload files here, I uploaded the original generated apache virtual host config file here: dpaste: CA5DP8CUM

First necessary fix is to add RewriteEngine on also in the :443 section. Somehow this is missing in my setup.

Now the websocket connection started working with Chrome browser, but for Firefox it is still not working.

In the Web-Developer tools in Firefox I found, that the Request header Connection is not only filled with “Upgrade”: Connection: keep-alive, Upgrade

So I think we have to replace

RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC] by
RewriteCond %{HTTP:CONNECTION} Upgrade [NC]

to get websockets running also in Firefox.

SYSTEM INFORMATION
OS type and version Ubuntu 24.04
Webmin version 2.202
Virtualmin version 7.20.2
Webserver version Apache/2.4.58 (Ubuntu)