Canada  united states of america usa  linkedinfacebook   Call Us Today: 866.646.6461

Enabling mod_proxy on Apache

A reverse proxy is a type of proxy server that takes HTTP requests and seamlessly distributes them to one or more backend servers. These are useful as apache load-balancers or a central location for web applications. (For example, if you have a main domain, you can have a subdirectory pointed to a web application located on a completely different server. Eg: as the main domain and can be sitting on a completely different server)

Since you are here, you are most likely looking how to enable this feature. We are using Ubuntu server, but the process is similar across all Linux based apache installs.

sudo a2enmod ssl
sudo a2enmod proxy
sudo a2enmod proxy_balancer
sudo a2enmod proxy_http

Once all these modules were enabled, restart apache:

service apache2 restart


Within virtulhost file, specify the app path on the server:

ProxyPass /myapp/
ProxyPassReverse /myapp/


/myapp/ is the URL which will be used to access the proxied path (ie from the public server is the url pointing to the internal server (the server that is being proxied)

ProxyPass and ProxyPassReverse are the back and forth communication. One sends requests to the server, while the other sends back the responses.

Last updated Feb 23, 2021