WebSocket & RewriteEngine On

SYSTEM INFORMATION
OS type and version Debian Linux 12
Webmin version 2.621
Virtualmin version 8.0.0 Professional
Webserver version Apache 2.4.66
Related packages N/A

Per this thread, there was a bug preventing the RewriteEngine on directive from being written when it should. I just created a new domain with websocket proxying and the SSL config file is still missing RewriteEngine on. Adding it myself fixes the websocket proxying issue.

Thanks for reporting this! What actions in the UI or API commands did you use to create the domain and enable websockets proxying?

I created a new VS from scratch via the following actions:

  1. Create Virtual Server; Only DNS and Apache checked
  2. Web Configuration → Proxy Paths: Local = / Destination = http://localhost:8448 Proxy Socket = Yes
  3. Configure Apache SSL Website → Edit Directives: In addition to the directory information, the following is shown;
ProxyPass /.well-known !
ProxyPass / http://localhost:8448
RemoveHandler .php
RemoveHandler .php8.4
SSLEngine on
SSLCertificateFile /etc/ssl/virtualmin/17699474672762180/ssl.combined
SSLCertificateKeyFile /etc/ssl/virtualmin/17699474672762180/ssl.key
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
ProxyPassReverse / http://localhost:8448
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade [NC]
RewriteRule ^/?(.*) "ws://localhost:8448/$1" [P]

RewriteEngine on is missing.

Thanks for reporting this! It’s definitely a bug.

You can find a fix in this patch:

webmin patch https://github.com/virtualmin/virtualmin-gpl/commit/732f4a3

Appreciate the quick response. You all have a great week!
Update: Patched, then setup a new proxy with websocket. Patch worked wonderfully. Thanks guys!

1 Like

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