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