Apache Reverse Proxy Configuration

<VirtualHost *:80>
ServerName default
Redirect 503 /
</VirtualHost>

<VirtualHost *:80>
servername site1.com
serveralias http://www.site1.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /site2 http://192.168.0.14:8080/site1/
ProxyPassReverse /site2 http://192.168.0.14:8080/site1/
ProxyPass / http://192.168.0.14:8080/
ProxyPassReverse / http:// 192.168.0.14:8080/
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.site1.com [NC]
RewriteRule ^(.*)$ http://site1.com/$1 [L,R=301]
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>

<VirtualHost *:80>
servername site2.com
serveralias http://www.site2.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://192.168.0.15:8080/
ProxyPassReverse / http://192.168.0.15:8080/
<Proxy *>
Order deny,allow
Deny from all
allow from 192.168.0.0/24
</Proxy>
</VirtualHost>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s