From 37893474b118aacfacb636ab67497107157ae8ed Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Sun, 16 Nov 2025 00:08:49 +0100 Subject: [PATCH] Refine Apache configuration for WebSocket upgrade handling This commit updates the Apache configuration to improve the handling of WebSocket upgrades by clarifying the RewriteCond conditions for the Upgrade and Connection headers. The changes enhance the readability of the configuration and ensure more reliable WebSocket connections, aligning with previous enhancements for real-time communication. --- apache.conf.example | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apache.conf.example b/apache.conf.example index bb3e300..539937e 100644 --- a/apache.conf.example +++ b/apache.conf.example @@ -36,12 +36,11 @@ # WICHTIG: mod_rewrite muss aktiviert sein (sudo a2enmod rewrite) # WebSocket-Upgrade erkennen und weiterleiten (wss:// -> ws://) - # Die RewriteRule wird nur ausgeführt, wenn Upgrade-Header vorhanden ist - # Andernfalls wird ProxyPass verwendet (für HTTP-Polling) + # Verwende RewriteRule, um WebSocket-Upgrades zu erkennen und weiterzuleiten RewriteEngine on - RewriteCond %{HTTP:Upgrade} =websocket [NC] - RewriteCond %{HTTP:Connection} =upgrade [NC] + RewriteCond %{HTTP:Upgrade} websocket [NC] + RewriteCond %{HTTP:Connection} upgrade [NC] RewriteRule ^/socket\.io/?(.*) ws://localhost:3050/socket.io/$1 [P,L,QSA] # Fallback für HTTP-Polling (wird verwendet, wenn RewriteRule nicht greift)