provide internet access to clients blocked by firewall
cache content to reduce network traffic
A forward proxy accepts requests from internal clients and forwards them to an external resource.
To configure this in Apache, we can simply control who has access to external resources by
specifying their IP address.
# Enables Apache to acting as forwarding server
# Adds Via header to requests
Deny from all
# Only allows this client to proxy requests
Allow from 192.168.0.11
A reverse proxy accepts requests from external clients and usually forwards them
to an internal resource.
To configure this in Apache, we use the ProxyPass and ProxyPassReverse directives.
# Prevents Apache from acting as forwarding server
# http://example.com/assets/css to be internally converted into a proxy request to http://cdn.example.com/css
ProxyPass /assets/ http://cdn.example.com/
# if http://cdn.example.com/css has a redirect to http://cdn.example.com/v2/css
# Apache will adjust the request to http://example.com/assets/v2/css before forwarding response
ProxyPassReverse /assets/ http://cdn.example.com/