5

Can't find out a solution. I'm not a lot into apache configs, but I currently need this to reroute to local server. I'm using solution for the reroute found somewhere in the internet. It worked. I have a connection, but I'm getting this error. WebSocket handshake: Unexpected response code: 400

Code:

<Location /tools/>
        RewriteEngine On

        RewriteCond %{REQUEST_URI}  ^/tools/socket.io            [NC]
        RewriteCond %{QUERY_STRING} transport=websocket          [NC]
        RewriteRule "^/tools/socket.io"           "ws://localhost:8080/socket.io/" [P,L]

        ProxyPass http://localhost:8080/
        ProxyPassReverse http://localhost:8080/
</Location>
GhoSTBG
  • 209
  • 3
  • 11
  • Weird, I would not expect the RewriteRule to match in Location context. Can you share a more complete sequence of full logs? I would remove all of this from Location context and follow a more basic example. – covener Jul 12 '17 at 00:52
  • Please see https://stackoverflow.com/questions/27526281/websockets-and-apache-proxy-how-to-configure-mod-proxy-wstunnel/27534443#27534443 – endo64 Sep 21 '17 at 13:28

1 Answers1

2

Use Apache command:

a2enmod proxy_wstunnel
systemctl restart apache2
dev0experiment
  • 462
  • 1
  • 7
  • 22