Setup a reverse proxy for Apache with mod_proxy_html 

Joined:
04/19/2010
Posts:
98

June 23, 2010 22:24:01    Last update: June 23, 2010 22:24:01
Required:
  1. Apache web server
  2. mod_proxy_html


proxy_html.conf:
# Load mod_proxy_html required SOs
LoadFile	/usr/local/lib/libxml2.so
LoadModule	proxy_html_module	modules/mod_proxy_html.so
LoadModule	xml2enc_module		modules/mod_xml2enc.so

# All knowledge of HTML links has been removed from the mod_proxy_html
# code itself, and is instead read from httpd.conf (or included file)
# at server startup.  So you MUST declare it.  This will normally be
# at top level, but can also be used in a <Location>.
#
# Here's the declaration for W3C HTML 4.01 and XHTML 1.0
ProxyHTMLLinks	a		href
ProxyHTMLLinks	area		href
ProxyHTMLLinks	link		href
ProxyHTMLLinks	img		src longdesc usemap
ProxyHTMLLinks	object		classid codebase data usemap
ProxyHTMLLinks	q		cite
ProxyHTMLLinks	blockquote	cite
ProxyHTMLLinks	ins		cite
ProxyHTMLLinks	del		cite
ProxyHTMLLinks	form		action
ProxyHTMLLinks	input		src usemap
ProxyHTMLLinks	head		profile
ProxyHTMLLinks	base		href
ProxyHTMLLinks	script		src for

# To support scripting events (with ProxyHTMLExtended On),
# you'll need to declare them too.

ProxyHTMLEvents	onclick ondblclick onmousedown onmouseup \
		onmouseover onmousemove onmouseout onkeypress \
		onkeydown onkeyup onfocus onblur onload \
		onunload onsubmit onreset onselect onchange

# Set custom FPI (Formal Public Identifier)
ProxyHTMLDocType "<!DOCTYPE html>"

# Proxy settings
ProxyRequests Off
ProxyPass /myWebApp http://127.0.0.1:8080/myWebApp
ProxyPassReverse /myWebApp http://127.0.0.1:8080/myWebApp
<Location /myWebApp>
	ProxyHTMLEnable On
	ProxyHTMLURLMap http://127.0.0.1:8080/myWebApp/ /myWebApp/
</Location>


httod.conf
# load proxy_html conf
Include conf/extra/proxy_html.conf


Share |
| Comment  | Tags