﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1589	realip module's effective level	cjhust@…		"http {
    real_ip_header X-Real-IP;
    set_real_ip_from 127.0.0.1;

    server {
        listen 8000;
        real_ip_header X-Forwarded-For;
        location / {
        ....
        }
    }
}

local test:
#curl ​http://127.0.0.1:8000/ 
$remote_addr = ""127.0.0.1""


#curl ​http://127.0.0.1:8000/ -H ""X-Forwarder-For: 2.2.2.2"" -H ""X-Real-IP: 1.1.1.1""
$remote_addr = ""1.1.1.1""


tracing the source code:
ngx_http_realip_handler is setted in POST_READ and PREACCESS phase.
if POST_READ phase meeting the conditions takes effect, it will call ngx_http_set_ctx(r, ctx, ngx_http_realip_module).
so that PREACCESS phase will skip.


I wonder to know why not location level takes effect in higher priority?
It's different from the other module's design idea of nginx.




"	defect	closed	minor		other	1.13.x	duplicate			3.10.0	1.13.6
