use a domain on one server to load an application on another server

Solution 1:

Here is a snippet of an article I wrote for reverse proxies. It is not exactly on topic with what you're trying to do, but may give you some direction and ideas.

There may be times when you need to have multiple web servers, but you have been given only one Public IP Address. The issue you will run into is that you want to have your multiple domains resolve the same IP address, but point to a different server. This is very doable with Apache. I configured a gateway server within my private cloud with an address of 192.168.1.2. I have several web servers with local addresses; 192.168.1.10 and 192.168.1.11 for example.

On my Gateway server, I install Apache and the mod_proxy files. Once this is complete, I am able to set up the virtual hosts to forward the domain.

<VirtualHost *:80>
   DocumentRoot /var/www/example.org
    ServerName *.example.org
    ProxyRequests Off
    <Proxy *>
      Order deny,allow
      Allow from all
    </Proxy>
    ProxyPreserveHost on
    ProxyPass / http://192.168.1.10/
    ProxyPassReverse / http://192.168.1.10
</VirtualHost>

<VirtualHost *:80>
   DocumentRoot /var/www/example.com
    ServerName *.example.com
    ProxyRequests Off
    <Proxy *>
      Order deny,allow
      Allow from all
    </Proxy>
    ProxyPreserveHost on
    ProxyPass / http://192.168.1.11/
    ProxyPassReverse / http://192.168.1.11/
</VirtualHost>

Restart Apache and configure your router to accept incoming connections to the 192.168.1.2 local address.