httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Selvig, Andy" <>
Subject [users@httpd] ProxyPassReverse Incorrectly Handling Redirects
Date Mon, 29 Oct 2007 16:03:05 GMT
Hello All-

I'm using Apache as a reverse proxy for multiple applications on a
single machine. These applications are running on various ports. I am
using mod_proxy to handle requests and mod_proxy_html to rewrite links.
Here's my setup:

Windows Server 2003 (no choice...)
Apache 2.2.6
mod_proxy_html 3

Here's the common part of my http_proxy.conf configuration file (which
I'm including using Include conf/http_proxy.conf from httpd.conf):

LoadModule proxy_module modules/ 
LoadModule proxy_http_module modules/ 
LoadModule headers_module    modules/
LoadFile modules/mod_proxy_html/libxml2.dll
LoadFile modules/mod_proxy_html/zlib1.dll
LoadFile modules/mod_proxy_html/iconv.dll
LoadModule proxy_html_module modules/mod_proxy_html/
ProxyRequests Off 

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

ProxyHTMLEvents onclick ondblclick onmousedown onmouseup \
onmouseover onmousemove onmouseout onkeypress \
onkeydown onkeyup onfocus onblur onload \
onunload onsubmit onreset onselect onchange
<Proxy *> 
  Order deny,allow 
  Allow from all 

ProxyHTMLExtended On

And here's the portion that defines one of the applications:

Alias /wtbasement "C:\rails\wtbasement\public"  
<Directory "C:\rails\wtbasement\public"> 
	Options Indexes FollowSymLinks 
	AllowOverride none 
	Order allow,deny 
	Allow from all 

ProxyPass /wtbasement/images ! 
ProxyPass /wtbasement/stylesheets ! 
ProxyPass /wtbasement/javascripts ! 
ProxyPass /wtbasement/ 
ProxyPass /wtbasement 
#ProxyPassReverse /wtbasement/ 

# reverse proxy link mapping
ProxyHTMLURLMap /wtbasement
<Location /wtbasement/>
	ProxyPassReverse /
	SetOutputFilter  proxy-html
	ProxyHTMLURLMap / /wtbasement/
	ProxyHTMLURLMap /wtbasement /wtbasement
	RequestHeader    unset  Accept-Encoding

In this case, I'm running an app called wtbasement on port 3004. The
regular proxy functionality seems to work fine, i.e.
http://localhost/wtbasement displays the home page properly. The
mod_proxy_html portion seems to work fine as well, i.e. links inside
html documents get rewritten from <a href="foo.htm"> to <a

The problem comes in when the application sends redirects to relative
pages. If the application redirects to /main/list, my browser goes to
this page:


when I want it to go to


I understand that this is the purpose for ProxyPassReverse, but it
doesn't seem to be happening the way I intend. I've tried calling
ProxyPassReverse inside and outside of the Location tags and it has no
effect. For reference, a similar issue was brought up in but it
didn't seem that there was any solution (the one listed did not work).

The error log for the case mentioned above has the following:

[Mon Oct 29 10:42:01 2007] [error] [client] File does not
exist: C:/apache/htdocs/main, referer: http://localhost/wtbasement/main

Apprently it is trying to redirect to C:/apache/htdocs/main instead of
http://localhost/wtbasement/main. How can I make it redirect

Thanks in advance for your help.

Andy Selvig

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message