How to Setup a Reverse Proxy With Apache HTTP Server on AlmaLinux 8

Let’s assume, we want to make the server sit in front of the localhost:8080 server.

a) Creating Virtual Host

Open the /etc/httpd/conf.d/sites.conf file on your favorite text editor with superuser privileges and add the lines below.

<VirtualHost *:80>

    ProxyPreserveHost On
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

b) Restarting

Restart the httpd service.
sudo systemctl restart httpd.service


Abdullah As-Sadeed

Abdullah As-Sadeed