From f4e5cf2edb91c9e6714c958fd71a10f52ec99076 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Sat, 15 Nov 2025 23:54:12 +0100 Subject: [PATCH] Enhance Apache configuration for WebSocket handling by preserving query strings This commit updates the Apache configuration to ensure that the query string is retained during WebSocket connections. The RewriteRule for the WebSocket upgrade has been modified to include the QSA flag, improving compatibility for applications relying on query parameters. These changes further optimize the server's handling of real-time communication. --- apache.conf.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apache.conf.example b/apache.conf.example index 7dd22f5..c362e06 100644 --- a/apache.conf.example +++ b/apache.conf.example @@ -37,12 +37,12 @@ # 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) + # WICHTIG: Query-String muss erhalten bleiben (QSA Flag) RewriteEngine on RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC] - RewriteRule ^/?(.*) ws://localhost:3050/$1 [P,L] + RewriteRule ^/socket\.io/?(.*) ws://localhost:3050/socket.io/$1 [P,L,QSA] # Fallback für HTTP-Polling (wird verwendet, wenn RewriteRule nicht greift) ProxyPass http://localhost:3050/socket.io/