[PATCH] Adds $orig_remote_addr in realip module

Maxim Dounin mdounin at mdounin.ru
Sat Jun 6 12:47:59 UTC 2015


Hello!

On Fri, Jun 05, 2015 at 10:18:52PM -0500, Jon Nalley wrote:

> # HG changeset patch
> # User Jon Nalley <code at bluebot.org>
> # Date 1433560679 18000
> #      Fri Jun 05 22:17:59 2015 -0500
> # Node ID b7c07ccca1f9be7038379cfd1077fb5885b3f388
> # Parent  62869a9b2e7d1b2b698cb1ca67ad664b37171113
> Adds $orig_remote_addr in realip module.
> 
> When the realip module sets $remote_addr, the connecting IP is
> no longer available for logging etc.  This change preserves the
> connecting IP as $orig_remote_addr.

[...]

> +static ngx_int_t
> +ngx_http_realip_orig_remote_addr_variable(ngx_http_request_t *r,
> +    ngx_http_variable_value_t *v, uintptr_t data)
> +{
> +    ngx_http_realip_ctx_t *ctx;
> +
> +    ctx = ngx_http_get_module_ctx(r, ngx_http_realip_module);

Ruslan already explained that this approach is wrong and won't 
work.

http://mailman.nginx.org/pipermail/nginx-devel/2015-May/006965.html

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



More information about the nginx-devel mailing list