Categories
apache

Apache: setup reverse proxy

Useful for situations where you need to hit APIs from websites that are not part of your domain, and you’d like to avoid the cross scripting limitations of JS without using jsonp

go at the top level of the config:
ProxyRequests On
ProxyVia On
Then setup the URL redirection:
proxyPass /adapter/ http://thefinaldestinationhere/evenwith/subdirectories
proxyPassReverse /adapter/ http://thefinaldestinationhere/evenwith/subdirectories
This is what my config currently looks like
ProxyRequests On
ProxyVia On
<VirtualHost *:80>
    DocumentRoot “/your/root/dir/here”
    ServerName local.admin.dev
    proxyPass /adapter/  http://thefinaldestinationhere/evenwith/subdirectories
    proxyPassReverse /adapter/ http://thefinaldestinationhere/evenwith/subdirectories
</VirtualHost>

Leave a Reply

Your email address will not be published. Required fields are marked *