Hello,
I experienced that if pen is sitting behind a proxy (eg. an apache
mod_proxy), then it is able to forward the X-Forwarded-For header on,
but will still use the tcp client address in the server selection
function. Which, if I'm not mistaken, is always the address of the proxy
server, and that means that there will be no real load balancing
performed (or at least not too fair).
Attached is a patch, that intends to work around this issue. It will
change the add_client function so that pen uses a prefetch buffer to get
the value of the X-Forwarded-For header, and then use that for server
selection. If it fails reading the header value, it will use the tcp
client address instead.
The patch can be applied against pen.c, v0.17.2.
Regards,
Balint
This archive was generated by hypermail 2.2.0 : Tue Sep 18 2007 - 12:53:33 CEST