I'm trying to allow the websocks in my reverse proxy with this:
<Location "/monitor">
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto https
RequestHeader set X-Forwarded-Port 443
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/monitor/notify [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule ^/monitor/notify/(.*) wss://localhost:8001/monitor/notify/$1 [P,L]
ProxyPass http://localhost:8001/monitor
ProxyPassReverse http://localhost:8001/monitor
</Location>
But I'm getting this error:
VM690:149 WebSocket connection to 'wss://MY.HOST/monitor/notify/516/q7pqnqdz/websocket' failed: Error during WebSocket handshake: Unexpected response code: 400
What I'm doing wrong?
Solved with this:
RewriteEngine On
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /monitor/(.*) ws://127.0.0.1:8001/monitor/$1 [P,L]