You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Володя К." <vo...@yandex.ua> on 2013/06/18 11:39:15 UTC

[users@httpd] mod_remoteip: server-status page does not show real ip

Hi,I have Server version: Apache/2.4.4 (Ubuntu) and nginx
 and I try setup mod_remoteip but without success.

I did next steps:
1. enable and configure mod_remoteip module
# cat remoteip.conf 
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy  212.12.x.x

# cat remoteip.load 
LoadModule remoteip_module /usr/lib/apache2/modules/mod_remoteip.so

2. change LogFormat directive to
LogFormat "%a %{host}i %l %u %D %T %{pid}P %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

(changed %h -> %a )

3. In nginx.conf i have
...
                        proxy_pass http://212.12.x.x:81;
                        proxy_redirect http://212.12.x.x:81/ /;
                        proxy_set_header Host $host;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_set_header X-Forwarded-Proto $scheme;
                        proxy_set_header X-Real-IP $remote_addr;
...


After this I can see real IP addresses in apache logs, but /server-status/ page shows  only frontend (nginx) IP-address  212.12.x.x

Can somebody help me to see real IP-addresses in server-status page ?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_remoteip: server-status page does not show real ip

Posted by Eric Covener <co...@gmail.com>.
first half of my last update was incorrect and meant to zap it -- it
doesn't happen too early, it just seems to side-step mod_remoteip.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_remoteip: server-status page does not show real ip

Posted by Eric Covener <co...@gmail.com>.
> After this I can see real IP addresses in apache logs, but /server-status/ page shows  only frontend (nginx) IP-address  212.12.x.x
> Can somebody help me to see real IP-addresses in server-status page ?

The code mod_status displays seems to be set very early when there is
a TCP connection but no headers yet.  Apache 2.4 allows per-request
notion of overriding the client address, but not at this early stage.
I would suggest opening a bug report that the cores
update_child_status_internal() does not appear to be affected by
mod_remoteip which results in mod_status always showing physical
client address.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_remoteip: server-status page does not show real ip

Posted by "Володя К." <vo...@yandex.ua>.

18.06.2013, 18:00, "David Guerra" <im...@gmail.com>:
> You have mod rpaf installed?
>

No,, I don't have mod_rpaf. But I have mod_remoteip ( apache-2.4)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_remoteip: server-status page does not show real ip

Posted by David Guerra <im...@gmail.com>.
I've never had luck getting remoteip fully working but I've got setups with
rpaf working with no issues.


On Tue, Jun 18, 2013 at 11:02 AM, Eric Covener <co...@gmail.com> wrote:

> On Tue, Jun 18, 2013 at 10:59 AM, David Guerra <im...@gmail.com>
> wrote:
> > You have mod rpaf installed?
>
> Doesn't mod_remoteip supercede it?
>
> >
> >
> > On Tue, Jun 18, 2013 at 10:50 AM, Володя К. <vo...@yandex.ua> wrote:
> >>
> >>
> >>
> >> 18.06.2013, 17:03, "David Guerra" <im...@gmail.com>:
> >> > This should be
> >> > helpful.
> http://www.daveperrett.com/articles/2009/08/10/passing-ips-to-apache-with-nginx-proxy/
> >> >
> >> > The issue is with Apache not accepting the real IP address from Nginx.
> >> >
> >>
> >> David, but after enabling mod_remoteip apache writes real IP-address is
> >> log files ! So I think apache accepts real ip from nginx.
> >> Problem is that mod-status does not show real ip!
> >>
> >> I think I configure module incorectly or this is apache's bug
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >> For additional commands, e-mail: users-help@httpd.apache.org
> >>
> >
> >
> >
> > --
> > Take Care,
> >
> > David Guerra
> > http://frustratedtech.com/
>
>
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Take Care,

David Guerra
http://frustratedtech.com/

Re: [users@httpd] mod_remoteip: server-status page does not show real ip

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jun 18, 2013 at 10:59 AM, David Guerra <im...@gmail.com> wrote:
> You have mod rpaf installed?

Doesn't mod_remoteip supercede it?

>
>
> On Tue, Jun 18, 2013 at 10:50 AM, Володя К. <vo...@yandex.ua> wrote:
>>
>>
>>
>> 18.06.2013, 17:03, "David Guerra" <im...@gmail.com>:
>> > This should be
>> > helpful.http://www.daveperrett.com/articles/2009/08/10/passing-ips-to-apache-with-nginx-proxy/
>> >
>> > The issue is with Apache not accepting the real IP address from Nginx.
>> >
>>
>> David, but after enabling mod_remoteip apache writes real IP-address is
>> log files ! So I think apache accepts real ip from nginx.
>> Problem is that mod-status does not show real ip!
>>
>> I think I configure module incorectly or this is apache's bug
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>
>
>
> --
> Take Care,
>
> David Guerra
> http://frustratedtech.com/



--
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_remoteip: server-status page does not show real ip

Posted by David Guerra <im...@gmail.com>.
You have mod rpaf installed?


On Tue, Jun 18, 2013 at 10:50 AM, Володя К. <vo...@yandex.ua> wrote:

>
>
> 18.06.2013, 17:03, "David Guerra" <im...@gmail.com>:
> > This should be helpful.
> http://www.daveperrett.com/articles/2009/08/10/passing-ips-to-apache-with-nginx-proxy/
> >
> > The issue is with Apache not accepting the real IP address from Nginx.
> >
>
> David, but after enabling mod_remoteip apache writes real IP-address is
> log files ! So I think apache accepts real ip from nginx.
> Problem is that mod-status does not show real ip!
>
> I think I configure module incorectly or this is apache's bug
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Take Care,

David Guerra
http://frustratedtech.com/

Re: [users@httpd] mod_remoteip: server-status page does not show real ip

Posted by "Володя К." <vo...@yandex.ua>.

18.06.2013, 17:03, "David Guerra" <im...@gmail.com>:
> This should be helpful.http://www.daveperrett.com/articles/2009/08/10/passing-ips-to-apache-with-nginx-proxy/
>
> The issue is with Apache not accepting the real IP address from Nginx.
>

David, but after enabling mod_remoteip apache writes real IP-address is log files ! So I think apache accepts real ip from nginx.
Problem is that mod-status does not show real ip!

I think I configure module incorectly or this is apache's bug

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_remoteip: server-status page does not show real ip

Posted by David Guerra <im...@gmail.com>.
This should be helpful.
http://www.daveperrett.com/articles/2009/08/10/passing-ips-to-apache-with-nginx-proxy/

The issue is with Apache not accepting the real IP address from Nginx.


On Tue, Jun 18, 2013 at 5:39 AM, Володя К. <vo...@yandex.ua> wrote:

> Hi,I have Server version: Apache/2.4.4 (Ubuntu) and nginx
>  and I try setup mod_remoteip but without success.
>
> I did next steps:
> 1. enable and configure mod_remoteip module
> # cat remoteip.conf
> RemoteIPHeader X-Forwarded-For
> RemoteIPTrustedProxy  212.12.x.x
>
> # cat remoteip.load
> LoadModule remoteip_module /usr/lib/apache2/modules/mod_remoteip.so
>
> 2. change LogFormat directive to
> LogFormat "%a %{host}i %l %u %D %T %{pid}P %t \"%r\" %>s %O
> \"%{Referer}i\" \"%{User-Agent}i\"" combined
>
> (changed %h -> %a )
>
> 3. In nginx.conf i have
> ...
>                         proxy_pass http://212.12.x.x:81;
>                         proxy_redirect http://212.12.x.x:81/ /;
>                         proxy_set_header Host $host;
>                         proxy_set_header X-Forwarded-For
> $proxy_add_x_forwarded_for;
>                         proxy_set_header X-Forwarded-Proto $scheme;
>                         proxy_set_header X-Real-IP $remote_addr;
> ...
>
>
> After this I can see real IP addresses in apache logs, but /server-status/
> page shows  only frontend (nginx) IP-address  212.12.x.x
>
> Can somebody help me to see real IP-addresses in server-status page ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Take Care,

David Guerra
http://frustratedtech.com/