How to use Apache as a proxy server

The following configuration allows you to make Apache forward the request for your domain to a second domain at port 8081. If the user enters “www.domain.com” in his browser he well see the content provided by the server listening at http://www.otherdomain.com:8081/. 


<VirtualHost *:80>
    ServerName www.testdomain.com
    ServerAlias testdomain.com *.testdomain.com
    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
 
    ProxyPass / http://www.testdomain.com:8081/
    ProxyPassReverse / http://www.testdomain.com:8081/
    <Location />
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>


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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: