title: How to reverse proxy a dynamic port with Apache?
body: <p>I make a request to this URL:
  <strong>wss://domain/websockify?port=6801</strong>
  The port parameter can change dynamically. How could I make ProxyPass to redirect to a dynamic port extracted from the URL?</p>
  
  <p>This is the configuration that works with a predefined port:</p>
  
  <pre><code>ProxyPass /websockify ws://localhost:6801/websockify/
  ProxyPassReverse /websockify ws://localhost:6801/websockify/
  </code></pre>
  
  <p>If I use ProxyPassMatch the apache tells me there is an error:</p>
  
  <pre><code>ProxyPassMatch ^/.*\?port=(.*)$ ws://localhost:$1/websockify/
  
  #ProxyPass Unable to parse URL: ws://localhost:$1/websockify/
  </code></pre>
  
  <p>I use apache 2.4.10</p>