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.
This commit is contained in:
@@ -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
|
||||
<LocationMatch "^/socket\.io/">
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user