title: Apache proxypass using a variable URL with interpolate
body: <p>I'm trying to set up an Apache server for test purposes. The goal is to simulate a load balancer. The part we're trying to simulate is simply accepting a clients secure httprequest and pass it on (via unsecure HTTP) to the correct server using <code>ProxyPass</code>. This all works 100%.</p>
  <p>The problem is this: I want to use this &quot;load balancer&quot; for several development environments. To be able to test the server-side of the applications, I want <code>ProxyPass</code> to use a variable URL to pass to, being the client’s IP. This will require using a variable URL in the <code>ProxyPass</code> rule. I’ve found the variable <code>REMOTE_ADDR</code>, but I cannot seem to use this in the <code>ProxyPass</code> rule. I first tried the syntax that the Apache website told me to use, but that didn’t work (getting a DNS lookup failure for <code>http://REMOTE_ADDR/foobar/</code>). I know I have to do something with <code>Interpolate</code>, but I cannot seem to figure out what exactly that would be.</p>
  <p>This line does what it should do, so the server works great:</p>
  <pre><code>ProxyPass / http://localhost:81/
  </code></pre>
  <p>These are the rules I've tried (using the variable) which failed.</p>
  <pre><code>ProxyPass / http://${REMOTE_ADDR}:81/
  Error: [client 127.0.0.1] proxy: DNS lookup failure for: ${remote_addr} returned by /
  </code></pre>
  <pre><code>ProxyPass / https://%{REMOTE_ADDR}s/
  Error: [client 127.0.0.1] proxy: DNS lookup failure for: %{remote_addr}s returned by /
  </code></pre>
  <pre><code>ProxyPassInterpolateEnv On
  ...
  ProxyPass / http://${REMOTE_ADDR}:81/ interpolate
  Error: [client 127.0.0.1] error parsing URL //:81: Invalid host/port
  </code></pre>
  <p>Anyone any ideas?</p>