Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Adds $orig_remote_addr in realip module

Maxim Dounin
June 07, 2015 08:34PM
Hello!

On Sat, Jun 06, 2015 at 08:46:07AM -0500, Jon Nalley wrote:

> Hi,
>
> I saw Ruslan's comments and responded (hoping to get a better
> understanding of the problem).
>
> http://mailman.nginx.org/pipermail/nginx-devel/2015-May/006974.html
>
> I had assumed that the issue with my prior patch was assigning the
> pointer from the context rather than copying the data.

Your assumption was wrong. The problem is simple: you can't use
contexts as long as stored data must survive internal
redirects.

Try logging your variable and check how it works for requests to
index files, in a configuration like this:

log_format test "remote_addr:$remote_addr orig:$orig_remote_addr";
access_log /dev/stderr test;

set_real_ip_from 127.0.0.1/32;

location / {
index index.html;
# assuming index.html exists
}

You'll see it won't work with requests to "/", since an internal
redirect to "/index.html" happens and clears module contexts.

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Adds $orig_remote_addr in realip module

Jon Nalley 751 June 05, 2015 11:16PM

Re: [PATCH] Adds $orig_remote_addr in realip module

Maxim Dounin 293 June 06, 2015 08:50AM

Re: [PATCH] Adds $orig_remote_addr in realip module

Jon Nalley 327 June 06, 2015 09:48AM

Re: [PATCH] Adds $orig_remote_addr in realip module

Maxim Dounin 293 June 07, 2015 08:34PM

Re: [PATCH] Adds $orig_remote_addr in realip module

Jon Nalley 321 June 08, 2015 12:42PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready