title: apache proxy configuration for socket.io (project not in root)
body: <p>I know there are several questions like this but i can't find one solving my problem for a project which is not in the server root.
  I have the following situation: I have an Apache server which runs several projects like: </p>
  
  <pre><code> 0.0.0.0/project1
   0.0.0.0/project2
  </code></pre>
  
  <p>I added a node.js project let's call it <code>nodeproject</code>. With ProxyPass I am passing  requests made to <code>0.0.0.0/nodeproject</code> to <code>0.0.0.0:8080</code> where my node server is running. This is all working fine except the websocket configuration for socket.io. </p>
  
  <p>In my <code>/etc/apache2/apache2.conf</code> file i placed this code to do the proxying. <code>mod_proxy_wstunnel</code> is enabeld Which i basically copied from <a href="https://gist.github.com/kassius/954e0787d6893c5ab8e1" rel="nofollow noreferrer">here</a>.</p>
  
  <pre><code>ProxyRequests off
  ProxyVia on
  
  RewriteEngine On
  RewriteCond %{REQUEST_URI}  ^/nodeproject/socket.io            [NC]
  RewriteCond %{QUERY_STRING} transport=websocket    [NC]
  RewriteRule /(.*)           ws://localhost:8080/$1 [P,L]
  
  ProxyPass        /nodeproject/socket.io http://localhost:8080/socket.io
  ProxyPassReverse /nodeproject/socket.io http://localhost:8080/socket.io
  
  &lt;Location /nodeproject&gt;
      ProxyPass http://localhost:8080
      ProxyPassReverse http://localhost:8080
  &lt;/Location&gt;
  </code></pre>
  
  <p>The failing request looks like this:</p>
  
  <pre><code>ws://0.0.0.0/nodeproject/socket.io/?EIO=3&amp;transport=websocket&amp;sid=MDuVcHmt3T1sa8ruAAAa
  </code></pre>
  
  <p>and i get a Bad Request 400 response.</p>
  
  <p>I am not an expert in configuring this kind of stuff where did I go wrong?</p>
  
  <p>Thanks in advance!</p>