How To Use Apache as a Reverse Proxy on Ubuntu 20.04

A reverse proxy is a type of proxy server that accepts HTTP (S) requests and transparently distributes them to one or more backend servers.
You can use a reverse proxy to prevent direct access to these underlying application servers. They can also be used to distribute the load of incoming requests to different application servers.
In this tutorial, you will configure Apache as a basic reverse proxy using the mod_proxy extension to redirect incoming connections to one or more backend servers running on the same network.
Install the Apache Web Server.
1 |
sudo apt install apache2 |
Enabling Necessary Apache Modules.
1 2 3 4 |
sudo a2enmod proxy sudo a2enmod proxy_http sudo a2enmod proxy_balancer sudo a2enmod lbmethod_byrequests |
If you need to enable the SSL module in Apache.
1 |
sudo a2enmod ssl |
To put these changes into effect, restart Apache.
1 |
sudo systemctl restart apache2 |