So I have figured out how to use virtualhost, proxypass and proxypassreverse. So far, so good.
The problem I'm experiencing is this:
I have a reverse proxy server running apache (123.123.123.123)
Behind this proxy server I have a http server running apache (124.124.124.124).
This http server has multiple sites (virtualhost), it's only reachable via the proxy server.
If i run a nslookup on
www.somedomain.com I get 123.123.123.123 (Not really but you understand what I mean)
I put my proxy to have the IP 123.123.123.123, so far so good. The requests come in to the proxy server.
I want my http server to be named 124.124.124.124.
In the http server I wish to set up my virtualhosts like this:
(simplified but you get it, right?)
<VirtualHost 124.124.124.124>
ServerName
www.somedomain.com
Documentroot /home/somedomain.com
</VirtualHost>
How do I get my proxy to grab the data from the http server?
If I do like this I will only make another request to my proxy server.
<VirtualHost www.somedomain.com>
ServerName
www.somedomain.com
PROXYRequests Off
ProxyPass /
http://www.somedomain.com/
ProxyPassReverse /
http://www.somedomain.com/
</VirtualHost>
If I do like this, only the first page in the httpd.conf in my http server will work.
<VirtualHost www.somedomain.com>
ServerName
www.somedomain.com
PROXYRequests Off
ProxyPass /
http://124.124.124.124/
ProxyPassReverse /
http://124.124.124.124/
</VirtualHost>
So how do I do it?
Do I need to setup a different DNS server for the proxy server? I would hate that. Perhaps use hosts-file in proxy. Or maybe I can use sub-domains?
All of the above are solutions that I would really hate to use, so is there a "best-practise" here?