From 5a2fd2d5bd6c065b58c1780e055f6aeb22b0a2f9 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 4 Sep 2025 00:23:55 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Apache=20WebSocket-Proxy=20f=C3=BCr=20Da?= =?UTF-8?q?emon-Service=20verbessert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: - 502 Proxy Error bei WebSocket-Verbindungen zu /ws/ - Apache konnte nicht mit Daemon-Service auf Port 4551 verbinden Lösung: - upgrade=websocket Parameter zu ProxyPass hinzugefügt - Reihenfolge der RewriteRules und ProxyPass optimiert - WebSocket-Upgrade-Requests werden jetzt korrekt behandelt Konfiguration: - RewriteRules für WebSocket-Upgrade vor ProxyPass - ProxyPass mit upgrade=websocket für /ws/ → ws://localhost:4551/ - Daemon-Service läuft auf Port 4551 und akzeptiert nur WebSocket-Verbindungen --- yourpart-https.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yourpart-https.conf b/yourpart-https.conf index 81dae51..4e4d2e2 100644 --- a/yourpart-https.conf +++ b/yourpart-https.conf @@ -26,10 +26,6 @@ ProxyPass "/socket.io/" "http://localhost:2020/socket.io/" ProxyPassReverse "/socket.io/" "http://localhost:2020/socket.io/" - # WebSocket-Proxy für Daemon-Verbindungen - ProxyPass "/ws/" "ws://localhost:4551/" - ProxyPassReverse "/ws/" "ws://localhost:4551/" - # WebSocket-Upgrade-Header für Socket.io RewriteEngine on RewriteCond %{HTTP:Upgrade} websocket [NC] @@ -40,6 +36,10 @@ RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC] RewriteRule ^/ws/(.*)$ "ws://localhost:4551/$1" [P,L] + + # WebSocket-Proxy für Daemon-Verbindungen (nur für WebSocket-Upgrade) + ProxyPass "/ws/" "ws://localhost:4551/" upgrade=websocket + ProxyPassReverse "/ws/" "ws://localhost:4551/" ErrorLog /var/log/apache2/yourpart.error.log CustomLog /var/log/apache2/yourpart.access.log combined