Mailing List Archive

Problems with remote_addr
Hi, I'm having troubles with mod_backhand client's remote address. We
are using fastcgi programs to do some simple things, but in our test
setup (a moderator plus two workhorses) one machine gets the correct ip
address (HTTP_REMOTE_ADDR), but the other keep getting the moderator's
ip. Both machines are using almost the same configuration.

The funny part is the fact that the same is happening with the
BackhandProxied header, in one machine it's swapped with the remote_addr
header.

Regards,
--
Leonardo Herrera L.
mailto:leus@epublish.cl
Problems with remote_addr [ In reply to ]
Leonardo Herrera wrote:

> Hi, I'm having troubles with mod_backhand client's remote address. We
> are using fastcgi programs to do some simple things, but in our test
> setup (a moderator plus two workhorses) one machine gets the correct
> ip address (HTTP_REMOTE_ADDR), but the other keep getting the
> moderator's ip. Both machines are using almost the same configuration.
>
> The funny part is the fact that the same is happening with the
> BackhandProxied header, in one machine it's swapped with the
> remote_addr header.

What is the "remote_addr header"? I am not familiar with that header.

All of the BackhandProxied header is handled in mod_backhand.c in the

backhand_post_read_request(request_rec *r)

Have a look there. It "automagically" reset the remote address in the
connection of the request structure... No other HTTP headers are munged
though. It _does not_ work like mod_proxy. mod_backhand allows the
application to proceed as if the the request were not proxied at all.

--
Theo Schlossnagle
Principal Consultant
OmniTI Computer Consulting, Inc. -- http://www.omniti.com/
Phone: +1 301 776 6376 Fax: +1 410 880 4879
1024D/82844984/95FD 30F1 489E 4613 F22E 491A 7E88 364C 8284 4984
2047R/33131B65/71 F7 95 64 49 76 5D BA 3D 90 B9 9F BE 27 24 E7
Problems with remote_addr [ In reply to ]
Theo Schlossnagle wrote:
> What is the "remote_addr header"? I am not familiar with that header.

getenv( "REMOTE_ADDR" ). I don't really know if this is standard, but
under fastcgi it always contains the client's ip.

> All of the BackhandProxied header is handled in mod_backhand.c in the
>
> backhand_post_read_request(request_rec *r)
>
> Have a look there. It "automagically" reset the remote address in the
> connection of the request structure... No other HTTP headers are munged
> though. It _does not_ work like mod_proxy. mod_backhand allows the
> application to proceed as if the the request were not proxied at all.

Yes, I know mod_backhand should do this, but in one of my machines it
doesn't work. Is there any configuration issue that can lead to this
strange behavior (multicaststats, acceptstats)?

Regards,
--
Leonardo Herrera L.
mailto:leus@epublish.cl
Problems with remote_addr [ In reply to ]
Leonardo Herrera wrote:

> Theo Schlossnagle wrote:
>
>> What is the "remote_addr header"? I am not familiar with that header.
>
> getenv( "REMOTE_ADDR" ). I don't really know if this is standard, but
> under fastcgi it always contains the client's ip.

That should work. I think mod_cgi (and I guess fastcgi) pull that from
the connection on the address.

>
> Yes, I know mod_backhand should do this, but in one of my machines it
> doesn't work. Is there any configuration issue that can lead to this
> strange behavior (multicaststats, acceptstats)?

The AcceptStats being wrong would cause this. If the AcceptStats
doesn't encompass the machine that is redirecting to you, then it will
not rewrite the address.

It could also feasibly have something to do with your module loading
order. Make sure they are identical on your two machines.

--
Theo Schlossnagle
Principal Consultant
OmniTI Computer Consulting, Inc. -- http://www.omniti.com/
Phone: +1 301 776 6376 Fax: +1 410 880 4879
1024D/82844984/95FD 30F1 489E 4613 F22E 491A 7E88 364C 8284 4984
2047R/33131B65/71 F7 95 64 49 76 5D BA 3D 90 B9 9F BE 27 24 E7