Apache mod_proxy, how to forward request into local network ip(server)

Posted by Beck on Server Fault See other posts from Server Fault or by Beck
Published on 2010-12-26T11:45:13Z Indexed on 2010/12/26 12:56 UTC
Read the original article Hit count: 234

Filed under:

Can't figure out, how to configure mod_proxy for this.

I have two domains, one is working fine at the moment. Second is bind to the same ip.

I need to forward requests from second domain to another server in local network.

like that:

domain1.com => 192.168.1.101
domain2.com => 192.168.1.102

What configuration or directives i should use?

Thanks ;)

Update

<VirtualHost *:80>
  ServerName www.domain2.com

  ProxyRequests Off
  ProxyPreserveHost On

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

  ProxyPass / http://192.168.1.103:8080/
  ProxyPassReverse / http://192.168.1.103:8080/
</VirtualHost>

It just doesn't redirect to second server. That's it. And when i restart apache, it says something with overlapping 80 port.

[warn] _default_ VirtualHost overlap on port 80, the first has precedence

© Server Fault or respective owner

Related posts about mod-proxy