I've configured a publicly accessible server with multiple virtual hosts. The requests for one virtual host need to be sent to a backend server. All the other requests need to be served locally.
The request for ALL the virtual hosts are passed on to the IP address specified in the ProxyPass directive once the website which needs to be proxied is enabled. When I try to visit any of the other virtual hosts I get the webpage from the proxied website. When disabling the proxied website all other virtual hosts resume normal operation and are served locally.
The config I have on the publicly accessible server for the virtual hosts: (other virtual hosts are copies of the same config)
<VirtualHost *:80> ServerName www.mainsite.com ServerAlias mainsite.com ServerAdmin firstname.lastname@example.org DirectoryIndex index.php DocumentRoot /var/www/mainsite.com <Directory /> AllowOverride None </Directory> LogLevel info ErrorLog /var/log/mainsite.com_err.log CustomLog /var/log/mainsite.com_access.log combined </VirtualHost>
The config I have on the publicly accessible server for the virtual host to be proxied:
<VirtualHost *:80> ServerName calendar.othersite.com ServerAdmin email@example.com ProxyRequests Off <Location /> ProxyPass http://192.168.0.1/ ProxyPassReverse http://192.168.0.1/ </Location> <Proxy> Order Allow,Deny Allow from all </Proxy> TransferLog /var/log/othersite.com_access.log ErrorLog /var/log/othersite.com_err.log CustomLog /var/log/othersite.com.log combined LogLevel debug </VirtualHost>