Use Apache as a Reverse Proxy to another Service

If you've got another web application running on your server, but still want it served up on port 80 or 443 you can use Apache's mod_proxy to forward traffic from Apache to your application.

An example would be if your web application is running on http://localhost:8080 you can use Apache to redirect traffic from to that web app. Simply create a new configuration file for Apache under /etc/httpd/conf.d with the following:

# Put this after the other LoadModule directives
LoadModule proxy_module /usr/lib/apache2/modules/
LoadModule proxy_http_module /usr/lib/apache2/modules/

# Put this with your other VirtualHosts, or at the bottom of the file
NameVirtualHost *
<VirtualHost *:80>

    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all

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

Restart Apache and you should be good to go.

systemctl restart httpd