How to pass a request from one apache server to another

You're going to want to do something like this on Server A:

NameVirtualHost *
<VirtualHost *>
    ServerName owncloud.mydomain.com

    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass / http://192.168.0.10:80/
    ProxyPassReverse / http://192.168.0.10:80/
    <Location />
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>

Depending on your application you may need to make use of one or all of the following:

  • X-Forwarded-For - The IP address of the client.
  • X-Forwarded-Host - The original host requested by the client in the Host HTTP request header.
  • X-Forwarded-Server - The hostname of the proxy server.

Take a look at the mod_proxy documentation for more tips and tricks.

References

  • Using Apache with virtual hosts and mod_proxy
  • Apache Module mod_proxy