mod_proxy problem working with forwarding to several IPs

mod_proxy problem working with forwarding to several IPs

am 09.03.2004 14:42:44 von Alexander Prohorenko

Dear Sirs.

There is a problem with mod_proxy when it tries to connect (forward, internal
proxy) to the domain name, which points to several IP addresses.

Eg. I'm using the mod_rewrite with [proxy|P] directive to have the internal
proxying for the specific address to http://www.domain.com/. But the domain
http://www.domain.com/ points to several IP addresses, which is used for
fail-over and (or?) some kind of load-balancing, eg.:

www.domain.com. IN A 10.0.10.1
IN A 10.0.10.2
IN A 10.0.10.3

Some of IPs generate connection reset, and supposedly mod_proxy should try
another IP address to connect. Unfortunetly, it does not this, and if it
recieves connection reset before the correct answer (eg. it tried broken
address before the working one) mod_proxy just hangs up with the nasty 502
error like this one:

Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /test/1231.

Reason: Could not connect to remote machine: Invalid argument

and the log file says:

[Tue Mar 9 06:30:25 2004] [error] [client 1.2.59.190] (22)Invalid argument:
proxy connect to 10.0.10.1 port 80 failed

Likely, IE, Squid and a lot of different browsers and proxies handle this
situation just fine, but not mod_proxy. Yes, I am aware that this is not
RFC-documented way of handling such situation, but looks pretty reasonable.

So the question is - are there any patch or special option exists or should I
patch it myself? ;)

Thanks and looking forward your help.

I'd also much appreciate if you'll send a carbon copy to whiteextrasy.net.

Thanks in advance!
----
http://torg.alkar.net