webserver

How do I set up a ProxyPass in Apache?

To set up a ProxyPass in Apache is generally pretty straightforward.

To proxy requests on serverA for / to port 8080 on serverB, you need a simple proxy like the example below:

ProxyPass / http://serverb.example.com:8080/
ProxyPassReverse / serverb.example.com:8080/

An example VirtualHost config is below:

<VirtualHost *:80>

ServerName servera.example.com

ProxyRequests Off
ProxyPreserveHost On

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

ProxyPass / http://serverb.example.com:8080/
ProxyPassReverse / http://serverb.example.com:8080/

<Location />
Order allow,deny
Allow from all
</Location>

</VirtualHost>

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top