Define the urls you want to re-direct to a different server:
ServerName www.myExternalDoomianName.com
ProxyPass / http://myInternalDnsName/ ( or ip address )
ProxyPassReverse / http:// myInternalDnsName / (or ip address )
ProxyPreserveHost on
ProxyPreserveHost keeps the host headers intact so the internal sever can still use virtual websites.
Enable the site ( debian/ubuntu specific )
A2ensite myReverseProxySites
Need some extra bits for apache:
apt-get install libapache2-mod-proxy-html
a2enmod proxy
a2enmod proxy_html
a2enmod headers
a2enmod proxy_connect
a2enmod proxy_balancer
Restart apache
/etc/init.d/apache2 restart
If something isn’t working start looking in the logs:
tail -f /var/log/apache2/error.log
4 comments: