Resources for Apache Reverse Proxy

Sample configuration

Listen 80
NameVirtualHost *:80

#Repeat below section for each proxy
<VirtualHost *:80>
    DocumentRoot /var/www/html

    # mod_proxy setup.
    ProxyPreserveHost On
    RequestHeader unset Authorization
    ProxyRequests Off
    ProxyPass /  http://somelocalserver:7503/
    ProxyPassReverse /  http://somelocalserver:7503/
    <Proxy *>
       Order deny,allow
       Allow from all
    ErrorLog logs/somelocalserver-7503-error_log
    CustomLog logs/somelocalserver-7503-access_log common

Sample configuration - yahoo

Below is a sample to show how apache redirects traffic to when accessing your apache server using reverse proxy. However any links on the page will redirect to yahoo directly in this example.

    <Location />
        Order allow,deny
        allow from all

Another example - shellinabox

Here all access to the said apache URL will redirect to localhost port 4200. This is useful to not have to open an additional port to serve out another service but access everything from apache (port 80, if so configured) by configuring a virtual apache host. Some services don't require ProxyPassReverse setting as there are no links to click on the target. This particular configuration was used to run shellinabox access over apache. Related topic: Startup script for shellinabox

    <Location />
        ProxyPass http://localhost:4200/
        Order allow,deny
        allow from all

QR Code
QR Code tech:apache:apache_reverse_proxy (generated for current page)