reverse proxying with apache

Ref: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

Module : mod_proxy.c

In httpd.conf , under bellow section all reverse proxy rules will go

<IfModule mod_proxy.c>
#ProxyRequests On

ProxyRequests Off
#
#<Proxy *>
# Order deny,allow
# Deny from all
# Allow from .example.com
#</Proxy>

#
# Enable/disable the handling of HTTP/1.1 “Via:” headers.
# (“Full” adds the server version; “Block” removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
#ProxyVia On

#
# To enable a cache of proxied content, uncomment the following lines.
# See http://httpd.apache.org/docs/2.2/mod/mod_cache.html for more details.
#
#<IfModule mod_disk_cache.c>
# CacheEnable disk /
# CacheRoot “/var/cache/mod_proxy”
#</IfModule>
#
#Add the Reverse Proxy rules

ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar

</IfModule>

#End of proxy directives.

Note : Make sure if you use reverse proxy then ProxyRequests is Off.

Leave a Reply