Fix: Apache WebSocket-Proxy für Daemon-Service verbessert
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user