You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Neil A. Hillard" <hi...@whl.co.uk> on 2005/01/10 18:10:09 UTC

Re: [users@httpd] Rewriting problems with Apache 2.0.51

Hi,

	I haven't managed to get anywhere with this particular problem.  
Does anyone have any ideas or should I try the modules & developer mailing 
lists ?  Or is there somewhere better to try?

	Many thanks in advance,


				Neil.

On Wed, 22 Dec 2004, Neil A. Hillard wrote:

> Hi,
> 
> 	I hope someone here can help me as I'm starting to pull my hair 
> out with this problem !!!
> 
> 	I've got Apache 2.0.51 running as an accelerator and am having 
> problems with the rewriting.  I followed Nick Kew's article at:
> 
> http://www.apacheweek.com/features/reverseproxies
> 
> to get the basic set up but am having problems with specific redirects 
> causing Apache to match the wrong rule.
> 
> Apache is being used purely as an accelerator to frontend a host of 
> different applications running on other servers and no content is being 
> served from the accelerator.
> 
> The following is what I think is the relevant part of the config, please 
> let me know if you'd like to see any other bits of it (names change to 
> protect the innocent :-):
> 
>  RewriteEngine on
>  RequestHeader   unset  Accept-Encoding
>  ProxyPass       /app1                http://server1.domain.com/app1
>  ProxyPass       /path1               http://server2.domain.com/path1
>  ProxyPass       /path2               http://server2.domain.com/path2
>  RewriteRule  ^/\$(.*)$               http://server2.domain.com/\$$1 [P]
> 
>  Redirect        /app2                     http://accel.domain.com/app2/
>  ProxyPass       /app2/                    http://server3.domain.com/
>  ProxyHTMLURLMap http://server3.domain.com /app2
>  <Location /app2/>
>   ProxyPassReverse /                       <====== OFFENDING LINE
>   SetOutputFilter proxy-html
>   ProxyHTMLURLMap /                        /app2/
>   ProxyHTMLURLMap /app2                    /app2
>  </Location>
> 
>  Redirect        /app3                     http://accel.domain.com/app3/
>  ProxyPass       /app3/                    http://server4.domain.com/
>  ProxyHTMLURLMap http://server4.domain.com /app3
>  <Location /app3/>
>   ProxyPassReverse /
>   SetOutputFilter proxy-html
>   ProxyHTMLURLMap /                        /app3/
>   ProxyHTMLURLMap /app3                    /app3
>  </Location>
> 
> 
> So, /app1 gets forwarded on to server1.domain.com/app1, /path1 and /path2 
> get forwarded to server2.domain.com/path1 and server2.domain.com/path2, 
> /app2 gets forwarded to server3.domain.com/ and /app3 gets forwarded to 
> server4.domain.com/.
> 
> This all seems to work, including the HTML rewriting unless an application 
> sends back a partial redirect.  Unfortunately these are commercial 
> applications which cannot be changed (I know that partial redirects are 
> against the RFCs !!!)
> 
> For example, a user goes to http://accel.domain.com/app3/.  This gets 
> proxied to http://server4.domain.com/.  As the user has not logged in, a 
> redirect is sent to '/login.html'.  When this reaches the client for some 
> reason it seems to have been rewritten by the 'ProxyPassReverse /' under 
> '/app2/' and not '/app3/' as would be expected.  The client receives a 
> redirect to:
> 
> http://accel.domain.com/app2/login.html
>                         ^^^^
> 
> Needless to say this URL doesn't work !!!  I've commented out that line 
> and it will then match the next ''ProxyPassReverse /' it finds (I 
> currently have a dozen or so backend servers !)
> 
> I have seen this occuring on a packet capture when monitoring both client 
> -> accelerator and accelerator -> backend server traffic.
> 
> Can anybody shed some light on this ?
> 
> Many, many thanks in advance,
> 
> 
> 				Neil.
> 
> 

-- 
Neil Hillard                    hillardn@whl.co.uk
Westland Helicopters Ltd.       http://www.whl.co.uk/

Disclaimer: This message does not necessarily reflect the
            views of Westland Helicopters Ltd.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org