﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1936	'set_real_ip_from' in location section is not processed before REWRITE_PHASE	p01arbear@…		"For the confuguration
{{{
    server {
        listen 1024 proxy_protocol;
        location / {
            real_ip_header proxy_protocol;
            set_real_ip_from 0.0.0.0/0;
            return 200 remote_addr=$remote_addr;
        }       
    } 
}}}
response on request
{{{
echo -en ""PROXY TCP4 4.4.4.4 5.5.5.5 1234 80\r\nGET / \n\n"" | nc -q-1 0 1024
}}}
is
{{{
remote_addr=127.0.0.1
}}}
It is wrong address. The same in the access log.

Moving real_ip* directives into the server section or removing 'return' provide the correct result.
{{{
    server {
        listen 1024 proxy_protocol;
        real_ip_header proxy_protocol;
        set_real_ip_from 0.0.0.0/0;
        location / {
            return 200 remote_addr=$remote_addr;
        }       
    } 
}}}
{{{
remote_addr=4.4.4.4
}}}

This happens due to missing call of ngx_http_realip_handler() with config of a location on PREACCESS_PHASE.
Because 'return' works off on REWRITE_PHASE."	defect	closed	minor		nginx-module	1.17.x	invalid	realip_module			1.17.8
