Fix: WebSocket-Verbindungen über Apache-Proxy routen
Apache-Konfiguration: - Füge WebSocket-Proxy für /ws/ Pfad hinzu - Leite WebSocket-Upgrade-Header korrekt weiter Frontend-Konfiguration: - Socket.io verwendet jetzt VITE_API_BASE_URL (über /socket.io/ Proxy) - Daemon WebSocket verwendet wss://www.your-part.de/ws - Chat WebSocket verwendet wss://www.your-part.de/ws Dies löst die 'operation is insecure' Fehler und ermöglicht WebSocket-Verbindungen über HTTPS.
This commit is contained in:
@@ -25,6 +25,16 @@
|
||||
# WebSocket-Requests an Backend weiterleiten
|
||||
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:2020/"
|
||||
ProxyPassReverse "/ws/" "ws://localhost:2020/"
|
||||
|
||||
# WebSocket-Upgrade-Header
|
||||
RewriteEngine on
|
||||
RewriteCond %{HTTP:Upgrade} websocket [NC]
|
||||
RewriteCond %{HTTP:Connection} upgrade [NC]
|
||||
RewriteRule ^/ws/(.*)$ "ws://localhost:2020/$1" [P,L]
|
||||
|
||||
ErrorLog /var/log/apache2/yourpart.error.log
|
||||
CustomLog /var/log/apache2/yourpart.access.log combined
|
||||
|
||||
Reference in New Issue
Block a user