title: Apache 2 forward proxy server returns 403 when requesting port 22
body: <p>I have an Apache 2 Debian web server running with the <code>mod_proxy</code>, <code>mod_proxy_CONNECT</code>, and <code>mod_proxy_HTTP</code> modules enabled. My goal is to be able to use it as a forward proxy server to tunnel an SSH session over the port 80. So, the SSH client should be able to use the proxy server (on port 80) to connect to the SSH server hosted on port 22. The proxy module is configured as such:</p>
  
  <pre><code>ProxyRequests On
  
  &lt;Proxy *&gt;
      AddDefaultCharset off
      Order Deny,Allow
      Allow from all
  &lt;/Proxy&gt;
  </code></pre>
  
  <p>When using the proxy to connect to any regular website, it works fine. It will also work when connecting to the SSH server on port 22 using the <code>GET</code> method in a browser. eg:</p>
  
  <pre><code>GET http://sshserver.com:22/ HTTP/1.1
  Host: sshserver.com:22
  </code></pre>
  
  <p>But, when using the <code>CONNECT</code> method (so we can use the SSH protocol), eg:</p>
  
  <pre><code>CONNECT sshserver.com:22 HTTP/1.1
  Host: sshserver.com:22
  </code></pre>
  
  <p>The server responds with a foreboding <code>403 Forbidden</code> response.</p>