diff --git a/apache-config-example.conf b/apache-config-example.conf index 8bdbee1..a77b744 100644 --- a/apache-config-example.conf +++ b/apache-config-example.conf @@ -28,21 +28,31 @@ Require all granted - # Rewrite-Regeln für unerwünschte Query-Parameter + # Rewrite-Engine für alle Rewrite-Regeln RewriteEngine On + + # Rewrite-Regeln für unerwünschte Query-Parameter RewriteCond %{QUERY_STRING} ^(.*)&?wtd=UrId0B0tLmuMAK9H&?(.*)$ [NC] RewriteRule ^ %{REQUEST_URI}?%1%2 [R=301,L] - # WebSocket-Support für Socket.IO - # Wichtig: Diese Regeln müssen VOR den ProxyPass-Regeln stehen! + # WebSocket-Support für Socket.IO (muss VOR normalem ProxyPass stehen!) + # Socket.IO verwendet /socket.io/ für Verbindungen RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC] - RewriteRule ^/?(.*) "ws://localhost:4000/$1" [P,L] + RewriteRule ^/socket\.io/(.*) ws://localhost:4000/socket.io/$1 [P,L] # Reverse Proxy zu Node.js # WICHTIG: ProxyPass muss ALLE Routen abfangen, auch / ProxyPreserveHost On + + # ProxyPass für Socket.IO (auch für Polling) + ProxyPass /socket.io/ http://localhost:4000/socket.io/ + ProxyPassReverse /socket.io/ http://localhost:4000/socket.io/ + + # Ausnahme für /ads.txt ProxyPass /ads.txt ! + + # Alle anderen Anfragen an Node.js ProxyPass / http://localhost:4000/ ProxyPassReverse / http://localhost:4000/