title: Apache Reverse Proxying CGI scripts
body: <p>I have a web application called <a href="http://www.steveshipway.org/software/rrd/f_routers.html" rel="nofollow noreferrer">routers2.cgi</a> which I am trying to proxy via an Apache 2.4 proxy server which does not work at the moment. </p>
  
  <p><strong>Direct URL to the web application server</strong></p>
  
  <pre><code>http://lab.server.com/cgi-bin/routers2.cgi
  </code></pre>
  
  <p><strong>Reverse proxy URL</strong></p>
  
  <pre><code>https://prod.server.com/routers2
  </code></pre>
  
  <p><strong>Configuration vhosts.conf from prod.server.com</strong></p>
  
  <pre><code># routes2.cgi
  ProxyPass "/routers2" "http://lab.server.com/cgi-bin/routers2.cgi"
  ProxyPassReverse "/routers2" "http://lab.server.com/cgi-bin/routers2.cgi"
  
  ProxyPass "/rrdicons" "http://lab.server.com/routers2/rrdicons"
  ProxyPassReverse "/rrdicons" "http://lab.server.com/routers2/rrdicons"
  
  ProxyPass "/graphs" "http://lab.server.com/routers2/graphs"
  ProxyPassReverse "/graphs" "http://lab.server.com/routers2/graphs"
  </code></pre>
  
  <p><strong>Reverse proxy log samples</strong></p>
  
  <pre><code>192.168.1.10 - - [13/Jun/2017:06:40:37 +0000] "GET /routers2 HTTP/1.1" 200 3481
  192.168.1.10 - - [13/Jun/2017:06:40:37 +0000] "GET /rrdicons/routers2.css HTTP/1.1" 304 -
  192.168.1.10 - - [13/Jun/2017:06:45:57 +0000] "GET /routers2 HTTP/1.1" 200 3481
  192.168.1.10 - - [13/Jun/2017:06:45:57 +0000] "GET /rrdicons/routers2.css HTTP/1.1" 304 -
  </code></pre>
  
  <p><strong>Sample URL from web application access log when accessing directly (no reverse proxy)</strong></p>
  
  <pre><code>192.168.1.9 - - [13/Jun/2017:05:50:46 +0000] "GET /routers2/graphs/devicessystem1.cfg-10.10.1.1_13-ws-x3.png HTTP/1.1" 200 27025 "http://lab.server.com/cgi-bin/routers2.cgi?rtr=devices%2Fsystem1.cfg&amp;bars=Cami&amp;xgtype=w&amp;page=graph&amp;xgstyle=x3&amp;xmtype=routers" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0"
  192.168.1.9 - - [13/Jun/2017:05:50:46 +0000] "GET /cgi-bin/routers2.cgi?rtr=devices%2Fsystem1.cfg&amp;bars=Cami&amp;xgtype=w&amp;page=menub&amp;xgstyle=x3&amp;if=_summary_&amp;xmtype=options HTTP/1.1" 200 12437 "http://lab.server.com/cgi-bin/routers2.cgi" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0"
  192.168.1.9 - - [13/Jun/2017:05:50:46 +0000] "GET /cgi-bin/routers2.cgi?rtr=devices%2Fsystem1.cfg&amp;bars=Cami&amp;xgtype=w&amp;page=menu&amp;xgstyle=x3&amp;xmtype=routers HTTP/1.1" 200 7847 "http://lab.server.com/cgi-bin/routers2.cgi" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0"
  </code></pre>
  
  <p><strong>Web application log via reverse proxy</strong></p>
  
  <pre><code>prod.server.com - - [13/Jun/2017:07:21:58 +0000] "GET /cgi-bin/routers2.cgi/ HTTP/1.1" 200 3481 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0"
  prod.server.com - - [13/Jun/2017:07:21:58 +0000] "GET /routers2/rrdicons/routers2.css HTTP/1.1" 304 - "https://prod.server.com/routers2/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0"
  </code></pre>
  
  <p>Does my vhosts ProxyPass and ProxyPassReverse configuration look correct?<br>
  Do I need something extra since we are proxying a cgi script?</p>