title: Configuring apache virtual hosts for one domain and multiple IP addresses
body: <p>I have two apache servers at two separate IP addresses and one domain name (example.com) administer on godaddy.com. I want to use this single domain to point traffic to my two separate servers over ssl.</p>
  
  <p>I set up the first server through a fios router with port forwarding and associated the public IP address with a DDNS address (xxx.ddns.net). My godaddy config looks like this:</p>
  
  <pre><code>Type    Name    Value   
  -------------------------------
  A       @       184.168.131.241
  CNAME   www     xxx.ddns.net
  
  
  Forwarding 
  ------------
  domain  https://www.example.com
  </code></pre>
  
  <p>... and my apache ssl.conf file looks like this:</p>
  
  <pre><code>&lt;VirtualHost *:443&gt;
      ...
      ServerName www.example.com
      DocumentRoot /var/www/html
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>This works fine, but now I want to set up a subdomain ('mysub') so that traffic directed to mysub.example.com gets handled by my second server available at a separate IP address (MY.2ND.IP.ADDR). I've tried all sorts of settings on godaddy and in the ssl.conf file, but to no avail. In particular, I've tried:</p>
  
  <ol>
  <li><p>Setting godaddy so that traffic sent to subdomain mysub.example.com is redirected straight to MY.2ND.IP.ADDR; it's not at all clear to me if this is possible. (Godaddy has a form under the title "Forwarding" and a subsection therein called "subdomain", but setting that subdomain to mysub and setting "forward to" to <a href="http://MY.2ND.IP.ADDR" rel="nofollow noreferrer">http://MY.2ND.IP.ADDR</a> doesn't seem to do anything; what is this 'subdomain' field in the godaddy interface supposed to be used for?)</p></li>
  <li><p>Directing all traffic to the first server, and configuring apache to proxy traffic for the subdomain on to the second server. </p></li>
  </ol>
  
  <p>I've tried adding another virtual host element to ssl.conf like so:</p>
  
  <pre><code>&lt;VirtualHost MY.2ND.IP.ADDR:443&gt;
      ServerName mysub.example.com
      &lt;Proxy *&gt;
          Order deny,allow
          Allow from all
      &lt;/Proxy&gt;
      &lt;Location /&gt;
              ProxyPass http://MY.2ND.IP.ADDR
              ProxyPassReverse http://MY.2ND.IP.ADDR
      &lt;/Location&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>... but this doesn't work either.</p>
  
  <p>In summary, what is the best way to direct traffic for a subdomain to a separate IP address using godaddy and/or apache configurations? </p>