Use websocket upgrade capability in apache > 2.4.47 which has been released in 2021, removing unecessary rewrite magic.

robertmx
2025-06-22 13:44:36 +02:00
parent e7a481f25a
commit a2b849dba9

@@ -512,16 +512,10 @@ On some OS's you can use a2enmod, for example with: `a2enmod proxy_wstunnel` and
CustomLog \${APACHE_LOG_DIR}/access.log combined
<Location /$sublocation/> #adjust here if necessary
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /notifications/hub(.*) ws://<SERVER>:<SERVER_PORT>/$sublocation/notifications/hub/$1 [P,L]
RewriteRule /notifications/anonymous-hub(.*) ws://<SERVER>:<SERVER_PORT>/fjbitwarden/notifications/anonymous-hub/$1 [P,L]
ProxyPass http://<SERVER>:<SERVER_PORT>/$sublocation
ProxyPass http://<SERVER>:<SERVER_PORT>/$sublocation upgrade=websocket
ProxyPreserveHost Off
RequestHeader set X-Real-IP %{REMOTE_ADDR}s
RequestHeader setifempty Connection "Upgrade"
RequestHeader setifempty Upgrade "websocket"
</Location>
</VirtualHost>
```